Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Datastore script wont load and doesnt say anythings wrong. How do i fix?

Asked by 6 years ago
Edited 6 years ago

I have this data store script and it sometimes loadings my tools like its supposed to do and sometimes it doesn't why does this not work


local ds = game:GetService("DataStoreService"):GetDataStore("toolsave555") game.Players.PlayerAdded:connect(function(plr) wait(2) local player = plr.UserId local data = ds:GetAsync(player) if data then for i,v in pairs(data) do if game.Workspace.axes:FindFirstChild(v) then local axe = game.Workspace.axes:FindFirstChild(v):Clone() axe.Parent = plr:WaitForChild("Backpack") end end end end) game.Players.PlayerRemoving:connect(function(plr) local player = plr.UserId local saved = {} for i,v in pairs(plr.Backpack:GetChildren()) do table.insert(saved,v.Name) end ds:SetAsync(player,saved) end)

1 answer

Log in to vote
-1
Answered by 6 years ago

Go on test and start a local server, with one player. If it doesnt say anything wrong then go on the player and press f9 and see whats wrong.

Ad

Answer this question