Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --HealthBarScript
- local player = game.Players.LocalPlayer
- local character = player.character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.HealthChanged:Connect(function(Damage)
- script.Parent.Size = UDim2.new(Damage / humanoid.MaxHealth, 0,1,0)
- end)
- --KillBrick
- script.Parent.Touched:Connect(function(hit)
- if hit and hit.Parent:FindFirstChild("Humanoid") then
- hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement