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

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

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

0
Have you tried putting a space between < and player.points.Value? Matthew7The3Worst5 0 — 3y
0
Its probably because the original saved value was below 0 Matthew7The3Worst5 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question