local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("RemoteSAVE")
local DataStore = game:GetService("DataStoreService")
local SaveCash1 = DataStore:GetDataStore("ExampleDataStore")
local RemoteLOAD = repStorage:WaitForChild("RemoteLOAD")
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "leaderstats"
local Bricks = Instance.new("IntValue",leader)
Bricks.Name = "Bricks"
Bricks.Value = 0
SaveCash1:SetAsync(player.UserId, Bricks.Value)
remote.OnServerEvent:connect(function(player )
print(Bricks.Value.. "Saved")
SaveCash1:SetAsync(player.UserId, Bricks.Value)
end)
RemoteLOAD.OnServerEvent:connect(function(player )
Bricks.Value = SaveCash1:GetAsync(player.UserId)
end)
wait(5)
for i = 1, 1000 do
wait(.5)
game.Players.Abrobot.leaderstats.Bricks.Value = game.Players.Abrobot.leaderstats.Bricks.Value + 1
end
end)
COMMUNITY QUESTION
I got my data save button to work but i cant get my load button to work HELP?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Wth is this script, you also forgot an end after line 14
Another problem is that your saving the moment the player joins wich means he won't have time to load in his values and it wiill get overwritten
I don't know what you mean about the missing end, but i see sew what you meant at line 15 and i fixed it i must have forgot to delete it.
Thank you so much its people like you that are what makes scripting helpers great.
Oh that end is at lind 38 btw