A local script sends a remote event to the script and the script uses player as the parameter to go into the maxhealth, but whenever a script like this is written:
RemoteEvent.OnServerEvent:Connect(function(player) local maxhealth = player.Character.Humanoid.MaxHealth maxhealth = 200 end)
nothing seems to happen to the max health of the player, and no errors are shown whatsoever
the variable will be equal to the MaxHealth of the player and in the next line of your code you will only change the variable to 200
use this
RemoteEvent.OnServerEvent:Connect(function(player) local maxhealth = 200 player.Character.Humanoid.MaxHealth = maxhealth end)