Hi I have a problem, please help me.
local Power = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Power")
local Char = game.Players.LocalPlayer.Character
Char:WaitForChild("Humanoid")
local function Set(Regen)
if Regen == true then
game.ReplicatedStorage.SetHealth:FireServer(Char, math.floor(100 + Power.Value/10), math.floor(100 + Power.Value/10))
else
game.ReplicatedStorage.SetHealth:FireServer(Char,nil, math.floor(100 + Power.Value/10))
end
end
Power.Changed:Connect(function()
Set(false)
end)
Char.Humanoid.Died:Connect(function()
game.Players.LocalPlayer.CharacterAdded:Wait()
Set(true)
end)
##OUTPUT:
PlayerScripts.HealthUp:3: attempt to index nil with 'WaitForChild'

2 comments
This a script or LocalScript?
Local script since he used LocalPlayer