Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why does this keep setting the level to 1? [closed]

Asked by 10 years ago
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...

Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
-2
Answered by 10 years ago

nvm... noob error

Ad