Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My little regeneration script is not working.A little help please?

Asked by
Tizzel40 243 Moderation Voter
5 years ago

here it is in 4 seconds my script's parent is going to be changed into an intValue called "ShieldPoints" and when that value is changed the scripts supposed to activate but its not...….

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)

    script.Parent = character:WaitForChild("ShieldPoints")
    wait(4)
print(script.Parent.Name)


script.Parent.Changed:Connect(function()     
    if script.Parent.Value < script.Parent.MaxShieldPoints.Value then


        repeat
            wait(1)
            print("Regenerating Stamina")
             script.Parent.Value = script.Parent.Value + script.Parent.MaxShieldPoints.Value/10
            until script.Parent.Value == script.Parent.MaxShieldPoints.Value

end



end)
end)
end)

---T40 [This script is located in the serverscriptservice]

0
Every time a player joins, the script is going to move to them and leave the current player. User#25115 0 — 5y

Answer this question