------------------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

0

math.floor(1/20) is 0. did you mess up the condition?

0

but if i do that i cant END the script

0

it stil doesn't work :p

0

if you do what?

0

i wrote it but it doesn't work well just dont mind this qeustion

0

Don't repsost a question..