for some reason its not working, no errors
local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("Cash24")
game.Players.PlayerAdded:Connect(function(plr)
local cash = game.ServerStorage.MoneyStorage:WaitForChild(plr.Name)
local success,err = pcall(function()
cash.Value = ds1:GetAsync(plr.UserId) or 0
end)
if success then
print("Your Data Has Been Loaded.")
else
print("Your Data Loading Has Failed.")
warn(err)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local cash = game.ServerStorage.MoneyStorage:FindFirstChild(plr.Name)
local success,err = pcall(function()
ds1:SetAsync(cash.Value, plr.UserId)
end)
if success then
print("Your Data Has Been Saved.")
else
print("We Got An Error While Saving Your Data.")
warn(err)
end
end)
