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

Why does this keep setting the level to 1?

game.Players.PlayerAdded:connect(function(player)
	player:WaitForDataReady()
    testdemlvl = player:LoadNumber('demlvl')
	if testdemlvl > 0 then
		demonlvl = player:LoadNumber('demlvl')
        player.PlayerGui.Level.DemonLevel.Text = 'Demon Lvl:'..demonlvl
    else
		player:SaveNumber('demlvl', 1)
	end
    testanglvl = player:LoadNumber('anglvl')
		if testanglvl > 0 then
		angellvl = player:LoadNumber('anglvl')
		player.PlayerGui.Level.AngelLevel.Text = 'Angel Lvl:'..angellvl

    else
        player:SaveNumber('anglvl', 1)        
	end
	RunService = game:GetService('RunService')
	RunService.Heartbeat:connect(function()
		player.PlayerGui.Level.DemonLevel.Text = 'Demon Lvl:'..demonlvl
		player.PlayerGui.Level.AngelLevel.Text = 'Angel Lvl:'..angellvl
	end)
	player.Chatted:connect(function(save)
		if save == '/save/' then
			player:SaveNumber('demlvl', 'demlvl')
			player:SaveNumber('anglvl', 'anglvl')
		end
	end)
	player.Chatted:connect(function(set)
		if save == '/set/' then
			player:SaveNumber('demlvl', 100)
			player:SaveNumber('anglvl', 100)
		end
	end)
end)

that is the script, it keeps setting the level to 1... I keep trying to use the /set/ command to set it to 100 but when i leave and come back it is 1 again...

1 answer

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