Datastore script wont load and doesnt say anythings wrong. How do i fix?
Asked by
7 years ago Edited 7 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
01 | local ds = game:GetService( "DataStoreService" ):GetDataStore( "toolsave555" ) |
03 | game.Players.PlayerAdded:connect( function (plr) |
05 | local player = plr.UserId |
06 | local data = ds:GetAsync(player) |
08 | for i,v in pairs (data) do |
10 | if game.Workspace.axes:FindFirstChild(v) then |
12 | local axe = game.Workspace.axes:FindFirstChild(v):Clone() |
13 | axe.Parent = plr:WaitForChild( "Backpack" ) |
22 | game.Players.PlayerRemoving:connect( function (plr) |
24 | local player = plr.UserId |
27 | for i,v in pairs (plr.Backpack:GetChildren()) do |
28 | table.insert(saved,v.Name) |
31 | ds:SetAsync(player,saved) |