script.AddHydration.OnServerEvent:Connect(function(player)
if player.leaderstats.Hydration.Value == script.Capacity.Value then
local num = (player.leaderstats.Hydration.Value)..0
player.leaderstats.Hydration.Value = num * (player.leaderstats.Rebirths.Value + 1)
else if player.leaderstats.Hydration.Value < script.Capacity.Value then
player.leaderstats.Hydration.Value = player.leaderstats.Hydration.Value + 5 * (player.leaderstats.Rebirths.Value + 1)
end
end
end)
if it’s a remote event then you should not be calling the event on the client. You should be calling the event from the server. Also if you update the value on the client it will not replicate to the server.
If this is a script then I don’t see anything wrong besides the fact that game.Players.LocalPlayer will only return a nil value.