#how to calculate pos as damage

9 messages · Page 1 of 1 (latest)

wraith raft
#

like if the bar is at the far left it does the least damage and at the near middle it does the most

            button.MouseButton1Click:Connect(function()
                script.Parent.TextBoxStuff.Visible = false
                script.Parent.PlayerAttackStuff.Visible = false
                script.Parent.FightImage.Visible = true
                script.Parent.FightImage.Bar.Visible = true
                game:GetService("TweenService"):Create(script.Parent.FightImage.Bar, TweenInfo.new(0.7, Enum.EasingStyle.Sine, Enum.EasingDirection.In, -1, true), {Position = UDim2.new(0.875, 0,0.145, 0)}):Play()
                button:Destroy()
                local button2 = Instance.new("TextButton")
                button2.Size = UDim2.new(1,0,1,0)
                button2.Parent = script.Parent
                button2.BackgroundTransparency = 1
                button2.TextTransparency = 1

                button2.MouseButton1Click:Connect(function()
                    bossHP = 0
                end)
            end)
#

kinda like a undertale damage system

rancid estuary
#

@wraith raft

#

instead of doing 1 large tween

#

do for say 20 small tweens

#

that go for every 5% of the bars length

#

and then whenever you stop charging the bar

#

see which checkpoint (which 5%) you are at

#

and use that for damage calculations