Hi i need help with this script.
Thats my problem:
local humanoid = script.Parent:WaitForChild("Humanoid")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("RemoteEvents")
local location = script.Parent:WaitForChild("Location")
local hum = script.Parent:Clone()
humanoid.HealthChanged:Connect(function(Damage)
script.Parent.BillboardGui.BackGround.Top.Size = UDim2.new(Damage / humanoid.MaxHealth, 0,1,0)
end)
game.Players.PlayerAdded:Connect(function(player)
humanoid.Died:Connect(function(plr)
Remotes:WaitForChild("HealthChanged"):FireClient(player, location)
script.Parent.CanCollide = false
script.Parent.Mesh.Transparency = 1
script.Parent.Mesh.CanCollide = false
script.Parent.BillboardGui.Enabled = false
wait(5)
hum.Parent = script.Parent.Parent
script.Parent:Destroy()
end)
end)