Hey, i have problem with DataStore. I think it should works fine, but it says always "no data found"..
Here is script:
local DataStore = game:GetService("DataStoreService"):GetDataStore("CashStore")
game.Players.PlayerAdded:connect(function(player)
if script.Parent.SettingsTab.CashSave.Value == true then
pcall(function()
local store = DataStore:GetAsync("u_"..player.userId)
if store then
print("Found cash data")
PlayerStats.Value = store
else
print ("No data found")
end
end)
end
end)
game.Players.PlayerRemoving:connect(function(player)
if script.Parent.SettingsTab.CashSave.Value == true then
pcall(function()
DataStore:SetAsync("u_"..PlayerStats.Value)
print("Saved")
end)
end
end)
It's not entire script, because script is long.

1 comment
Oh.. okay, works fine. Thank you. Anyway that was my first time with DataStores lol