DataStore2: attempt to call a nil value

Hello Developers,
I just created a script that saves the bucks of each player each time the value of the bucks changes, (conclusion a DataStore2 script).
the problem is that I am getting an error in the Output.

–Output

–the script

any solution? :thinking:

1 Like

BucksDataStore is not defined.
Add a variable after the PlayerAdded connection:

local BucksDataStore = DataStore2("Bucks", plr)

And it should be :Get(100) not :get(100)

" And it should be :Get(100) not :get(100)"
Solution :ballot_box_with_check:
thanks

Also keep in mind that the ID version of the module is outdated, so you should get a copy of the most up to date one from GitHub - Kampfkarren/Roblox: Scripts and stuff I wrote for Roblox. Documentation is little to none as these are just stuff I took from my game that I thought I could share.