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

how come this is still saving even when the score is lower then the saved score?

        leaderboardstore = datastoreservice:GetOrderedDataStore(songName)


        if leaderboardstore:GetAsync(player.UserId) or 0 <player.Points.Value then
            debounce = true
            wait(1)
            leaderboardstore:SetAsync(player.UserId, player.Points.Value)
            player.Points.Value = 0
        
            wait(10)
            debounce = false
    end
    
    end
    end)

im not too sure why, everything is correct with the leaderboard and stuff.

2 comments

0

Have you tried putting a space between < and player.points.Value?

0

Its probably because the original saved value was below 0

1 answer

It's probably because the leaderboardstore value was already negative, and since it exists, it saved. I would also recommend, that you change or 0 <player.Points.Value to player.Points.Value > 0

This isn't part of the question, but you need a and if debounce = false in your if statement unless you are doing the debounce for a different reason

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