Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to add experience value every 5 sec?

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 / 1000)
		
	
	end)
	
end)



local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
local level = leaderstats:WaitForChild('level')
local xp = player:WaitForChild('exp')

level.Changed:connect(function()
	if xp.Value < 1000 then
		level.Value = 1
		
     end
end)

i tried really hard to make this but i don't know how to continue, i wanted it to give 100 'experience' every 5 seconds. thanks in advanced

1 comment

0

my script works now i made a mistake in (experience.value / 1000) it should have been (experience.Value/ 1000)

1 answer

Line 14 experience.value should be experience.Value

2 comments

0

yeah i already said that

0

but thanks either way

This discussion is preserved as it was. New answers, comments, and votes are closed.