this script is supposed to bring up the XP value every second. but it doesnt work what is wrong?
player = game.Players.LocalPlayer tats = player.Stats xp = tats.XP function change() wait(1) xp.Value = xp.Value + 10 if xp.Value == 100 then end end
There are two reasons to your problem.
First, you never call your change()
function, so its body is never executed.
Secondly, even if you did call your change()
function, there is no loop, so it would only be
executed once.
player = game.Players.LocalPlayer local stats = player.stats local xp = stats.xp function change() while true do -- Infinite loop. xp.Value = xp.Value + 10 if xp.Value == 100 then -- Do something. end wait(1) -- We wait one second and proceed to the next step of the loop. end end change() -- We call change().