i need this script that changes xpneeded on each lvl ex:
game.Players.LocalPlayer.leaderstats.Level.Changed:connect(function() if game.Players.LocalPlayer.leaderstats.Level == 1 then game.Players.LocalPlayer.XpNeeded.Value = 200 end end)
...... if found any wrong spelling its cus i dindt copy paste
but can soemone tell me how to change an intvalue in a (local)script because idk how to
you missed Value after Level and that is crucial for any value (expect when calling .Changed)
local playerdata = game.Players.LocalPlayer:WaitForChild("leaderstats") playerdata.Level.Changed:connect(function() if playerdata.Level.Value == 1 then playerdata.XpNeeded.Value = 200 elseif playerdata.Level.Value == 2 then playerdata.XpNeeded.Value = 2000 --any number you want end end)
this one will change your XPNeeded to any number you want instead of using math. either way is okay. i Like defining my own exp instead of using math for it
It's simple. You can just do Value = Value + Number
or Value = Value - Number
or Value = Value * Number
(+ - / * % ^ etc.)
I suppose you want to get XpNeeded = Level * 200, we can do this with basic math.
game.Players.LocalPlayer.leaderstats.Level.Changed:connect(function() game.Players.LocalPlayer.XpNeeded.Value = game.Players.LocalPlayer.leaderstats.Level.Value * 200 end)
Any questions? feel free to add a comment.