So with this code in a normal script in StarterCharacterScripts inside StarterPlayer it only changes 1 Players maxhealth. I cant find the reason for that.
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(Char) --fires when the character is added, this includes when the player dies aswell if Char:FindFirstChild("Humanoid") then Char.Humanoid.MaxHealth = 200 --Change max health first Char.Humanoid.Health = 200 -- then change the health itself print("Health changed for"..plr.Name) end end) end)
EDIT: Its random if a player gets the new maxhealth or not. So sometimes 0 players and sometimes 1 or more
I can see one major problem at first glance, that being PlayerAdded is a server event, and using it on the client shouldn't work. Therefore, this should be in a script located preferably in ServerScriptService.
Add a wait(1) in between line 2 and 3