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
This should work.
--[[ Normal script inside workspace --]] game.Players.PlayerAdded:Connect(funtion(plr) -- You can use something else instead of "plr". locals stats = instance.new("Model", plr) -- Change "stats" to whatever you want. stats.Name = "leaderstats" -- Do not change this except the "stats" part if you changed it up. local lvl = instance.new("IntValue", stats) -- Change "lvl" to anything. lvl.Name = "Level" lvl.Value = 1 -- This is the starting level, change it to anything you want. if lvl.Value > 6000 then lvl.Value = 6000 end end)