I'm making where when a player goes over the level limit, it stops them at the max level you can be. I'm getting no errors whatsoever though, and the script won't work. Help?
--LOCAL SCRIPT--
local RS = game:GetService("ReplicatedStorage")
local remotef = RS.RemoteFunctions:WaitForChild("MaxyAssist")
local MV = remotef:InvokeServer(6000)
if game.Players.LocalPlayer.leaderstats.Level.Value >= (MV) then
game.Players.LocalPlayer.leaderstats.Level.Value = (MV)
--SERVER SCRIPT--
function lV (player,levelMax)
return levelMax
end
game.ReplicatedStorage:WaitForChild("RemoteFunctions").MaxyAssist.OnServerInvoke = lV

2 comments
If you're using a LocalScript, why are you using OnServerInvoke? Also your script gives the client too much power.
where is the part where it's supposed to prevent going above max level? I don't see any sort of restriction