Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
- local char = player.Character or player.CharacterAdded:Wait()
- local humanoid = char:WaitForChild("Humanoid")
- local healthGui = script.Parent.ScreenGui.Health
- humanoid:GetPropertyChangedSignal("Health"):Connect(function()
- local healthChange = humanoid.Health/(humanoid.MaxHealth)
- healthGui.HPBar:TweenSize(UDim2.new(healthChange,0,1,0),"In","Linear",1)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement