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

Attempt to index nil with "Bucks" ?

Asked by
CodeWon 181
3 years ago

So I was making a data store I got an error

"Attempt to index nil with Bucks"

Script:

    if success then
        jacobBucks.Value = player_data.Bucks
    end

    local player_data = {
        Bucks = player.leaderstats.Bucks.Value
    }
0
What is player defined as? And is it in a function? OhBrotherGaminYT 11 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

When initializing Bucks, try using WaitForChild, You most likely tried to access Bucks before it loaded, if you are trying to use the explorer for Bucks

Ad

Answer this question