I had this script that is supposed to check to see if you are below lvl 0, and make you lvl 1, my first script, this:
local lvl = plr.leaderstats.levels.Value
local xp = plr.leaderstats.xp.Value
if lvl <= 0 then
lvl = 1
end
didn't work, but then I just started messing around to try and get it to work and stumbled upon a working solution, but I have no clue why it works, and the original one doesn't, here's my working code:
local lvl = plr.leaderstats.levels
local xp = plr.leaderstats.xp
if lvl.Value <= 0 then
lvl.Value = 1
end
Can anybody explain to me why I couldn't define the .Value at the top of the script, and had to define it every time?
