``local datastore = game:GetService("DataStoreService")
local data1 = datastore:GetDataStore("Data1")
game.Players.PlayerAdded:Connect(function(player)
local Data = Instance.new("Folder",player)
Data.Name = "leaderstats"
local cash = Instance.new("IntValue", Data)
cash.Name = "Cash"
cash.Value = data1:GetAsync(player.UserId) or 10
data1:GetAsync(player.UserId, cash.Value)
cash.Changed:Connect(function()
data1:GetAsync(player.UserId, cash.Value)
end)
game.Players.PlayerRemoving:Connect(function()
data1:GetAsync(player.UserId, cash.Value)
end)
while wait(30) do
data1:GetAsync(player.UserId, cash.Value)
end
end)
Help me no data saving script works for me.

2 comments
Ok first off for the love of everything holy do not make it save every 30 seconds. Make it load when they join and save when they leave.
And possibly every time something really important happens.