Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.