oof, I was trying to make a save function for my new money system regarding the leaderstats. I guess I did something wrong...again.
Current script Located in workspace
local DS = game:GetService("DataStoreService"):GetDataStore("Points")
function PlayerAdded(player)
local folder = Instance.new("Folder",player)
folder.Name= "leaderstats"
local Balance = Instance.new("IntValue",folder)
Balance.Name="Balance"
Balance.Value = 0
while true do
wait(2.5)
Balance.Value = Balance.Value + 1
DS:SetAsync(player.userId.."_DS", Balance.Value)
end
end
game.Players.PlayerAdded:Connect(PlayerAdded)
Script before I attempted to save Located in workspace
function PlayerAdded(player)
local folder = Instance.new("Folder",player)
folder.Name= "leaderstats"
local Balance = Instance.new("IntValue",folder)
Balance.Name="Balance"
Balance.Value = 0
while true do
wait(2.5)
Balance.Value = Balance.Value + 1
end
end
game.Players.PlayerAdded:Connect(PlayerAdded)

1 comment
Changing that didnt work either.