Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Subscribe to @darkusblox for more :)
- local humanoid = script.Parent:FindFirstChild("Humanoid")
- local HP = humanoid.Health
- local IndicatorGui = script.Parent:FindFirstChild("IndicatorGui")
- humanoid.Changed:Connect(function()
- if HP > humanoid.Health then
- local damage = humanoid.Health - HP
- local newGui = IndicatorGui:Clone()
- newGui.TextLabel.TextColor3 = Color3.fromRGB(255,0,0)
- newGui.TextLabel.Text = damage
- newGui.Parent = script.Parent
- newGui.StudsOffset = Vector3.new(math.random(-3,3),0.5,math.random(-2,2))
- newGui.Enabled = true
- HP = humanoid.Health
- task.wait(0.5)
- newGui:Destroy()
- elseif HP < humanoid.Health and HP ~= 0 and humanoid.Health ~= 0 then
- local heal = humanoid.Health - HP
- local newGui = IndicatorGui:Clone()
- newGui.TextLabel.TextColor3 = Color3.fromRGB(0,255,0)
- newGui.TextLabel.Text = "+"..heal
- newGui.Parent = script.Parent
- newGui.StudsOffset = Vector3.new(math.random(-3,3),0.5,math.random(-2,2))
- newGui.Enabled = true
- HP = humanoid.Health
- task.wait(0.5)
- newGui:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement