#Data Saving

1 messages · Page 1 of 1 (latest)

candid drum
#

i have a script that saves tools through attributes its saving for my friend but not for me any help

spring sleetBOT
#

studio** You are now Level 3! **studio

candid drum
fringe pasture
#

make sure every tool in serverstorage has a ToolID attribute

#

@candid drum

candid drum
#

yes right now i have toolid on one tool for testing or does all of them have to for it to work

fringe pasture
#

Just make sure the tools you care about saving have the ToolID attribute

#

the rest will be ignored

candid drum
#

ye i have it to one tool but it wasnt getting added back to my inventory

#

but it was working for my friend

#

so i dont know if it was my game that is glitched because ive re opened studio and its still not working for me

fringe pasture
#

its probably a local datastore issue

spring sleetBOT
#

studio** You are now Level 1! **studio

candid drum
#

do you know anyway to fix it?

fringe pasture
#

add this to a temp script

#

PlayerDataStore:RemoveAsync(tostring(player.UserId))

candid drum
#

will that only wipe my data/

fringe pasture
#

yeah

candid drum
#

ok

fringe pasture
#

it resets it

candid drum
#

put into a server script sevice ye?

fringe pasture
#

also make sure api services are enabled in studio

candid drum
#

ye they are

fringe pasture
#

btw only run it once then delete it

candid drum
fringe pasture
#

mb i was away for a bit

candid drum
#

all good what do i do about this error

fringe pasture
#

try using this instead it has a print so u can see when it does it correctly

#

local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")

local PlayerDataStore = DataStoreService:GetDataStore("PlayerData")

Players.PlayerAdded:Connect(function(player)
PlayerDataStore:RemoveAsync(tostring(player.UserId))
print("Cleared saved data for", player.Name)
end)

candid drum
#

ok in output i got cleared saved data

#

then i went to test the data save and it didnt save it