When creating a Leveling script you have to use the PlayerAdded Event to add the certain Int Values. Such as XP,XPCap and Level. When using the PlayerAdded in your script you are unable to say to change Those XP,XPCap and Level Values on the client side. must do so in the Server.
So then how can I fire this to the Server? But at the same time keep the code inside the PlayerAdded function. Or is there a better way? I don't have my script on me but i'll try to write one. Here's my attempt.(won't be perfect)
Server Script
--Variables--
game.Players.PlayerAdded:Connect(function()
Level = Instance.new("IntValue")
Level.Parent = Player
XP = Instance.new("IntValue")
XP.Parent = Player
XPCap = Instance.new("IntValue")
XPCap.Parent = Player
while true do
wait()
if XP <= XPCap then
Level.Value = Level.Value + 1
end
end
end)
--I'm on my phone so i can't write a full script but show you what i mean--
Hopefully this makes sense
