------------------script---------------------
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local experience = Instance.new('IntValue', stats)
experience.Name = 'EXP'
experience.Value = 0
local level = Instance.new('IntValue', stats)
level.Name = 'level'
level.Value = 0
experience.Changed:connect(function()
level.Value = math.floor(experience.Value / 10)
end)
spawn(function()
while true do
wait(3)
experience.Value = experience.Value + 1
if experience.Value == 1 then
level.Value = math.floor(experience.Value / 20)
end
end
end)
end)
-------------local script------------------------
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
local level = leaderstats:WaitForChild('level')
local xp = player:WaitForChild('exp')
local experience
level.Changed:connect(function()
if xp.Value < 10 then
level.Value = 1
end
end
the problem lies in here :
if experience.Value == 1 then
level.Value = math.floor(experience.Value / 20)
end
i wanted to make it so that if the player reached level 1 (10 experience) he would need 20 experience to get to level 2 can somebody help me

6 comments
math.floor(1/20) is 0. did you mess up the condition?
but if i do that i cant END the script
it stil doesn't work :p
if you do what?
i wrote it but it doesn't work well just dont mind this qeustion
Don't repsost a question..