Hello, DataStoreService is not working but there are no messages in the output. Script for DataStore.
I will not be taking help right now. Once I get back I will find the one that works and I will mark this post as fixed
Hello, DataStoreService is not working but there are no messages in the output. Script for DataStore.
I will not be taking help right now. Once I get back I will find the one that works and I will mark this post as fixed
Are API Services enabled? Lol
Also, you may wanna wrap your DataStore functions in pcalls
to ensure that they will save or not
API Services are enabled. Also I don’t know what are pcalls
They’re basically just protective calls
to check that the data will save/load right
local success, whoops = pcall(function()
if success then
print("Saved the data of the player")
end
end)
If I recall correctly that is
Now I did it i and this is what happend.
Are you sure the leaderstats value still exists when the PlayerRemoving event fires?
Your DataStore code looks fine at a glance, although it should be beefed up with some protective pcall’s like @JackscarIitt recommended and there is more info here: Data Stores | Documentation - Roblox Creator Hub
I would recommend a simple test: print Strength.Value and Cash.Value in console before SetAsync, also… “plr.userId” is a typo in both places you used it, should be plr.UserId
And when you test the printing strength value and cash value, do it in Run → Server mode
You are missing an end
in your script.