Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Thanks for using this script
- This script is made by Joriangames/Problox Studio Scripts
- Want to know how to use this and script explanation?
- Check the video here: https://youtu.be/6aqejsMdy3c
- ]]
- local TS = game:GetService("TweenService")
- local Tinfo = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
- local DamageEvent = game.ReplicatedStorage.DamageEvent --You can remove this line since it is actually unnecessary
- local DamageBoard = game.ReplicatedStorage.DamageBoard
- local Red = Color3.fromRGB(255, 0, 0)
- local Green = Color3.fromRGB(95,111,64)
- game.Players.PlayerAdded:Connect(function(plr)
- plr.CharacterAdded:Connect(function(char)
- local hum = char:WaitForChild("Humanoid")
- local humH = hum.Health
- hum.HealthChanged:Connect(function(Health)
- if Health < humH and Health > 0 then
- local Damage = math.floor(humH - Health)
- print(Damage.." Damage was taken")
- local BoardClone = DamageBoard:Clone()
- BoardClone:FindFirstChild("Damage").Text = Damage
- local maxH = hum.MaxHealth
- BoardClone.Damage.TextColor3 = Green:lerp(Red, Damage / maxH)
- BoardClone.Parent = char.HumanoidRootPart
- BoardClone.Damage:TweenSize(UDim2.new(1,0,1,0), "InOut", "Quint", 0.3)
- wait(0.3)
- local UIupTween = TS:Create(BoardClone, Tinfo, {StudsOffset = BoardClone.StudsOffset + Vector3.new(0,1,0)})
- local textFade = TS:Create(BoardClone.Damage, Tinfo, {TextTransparency = 1})
- UIupTween:Play()
- textFade:Play()
- game:GetService("Debris"):AddItem(BoardClone, 0.5)
- end
- humH = hum.Health
- end)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement