Alright so. I'm unable to figure out how to make this
game.Workspace.Localplayer.Humanoid.Health = 10
but with a serversided script and changing the Localplayer variable to something that works serversided.
For example
if game.Players.Localplayer.leaderstats.Power.Value == 35 then game.Workspace.Localplayer.Humanoid.Health = 10 -- Just for testing print(Localplayer.Name + " has 35 in power" + game.Workspace.playername.Humanoid.Health == 10) end
If you wanted to do it for all players, you can use PlayerAdded in a server script:
game.Players.PlayerAdded:Connect(function(plr) plr:WaitForChild("leaderstats"):WaitForChild("Power").Changed:Connect(function(newVal) if newVal == 35 and plr.Character then plr.Character:WaitForChild("Humanoid").Health = 10 end end) end)