so, i am trying to save the tool the player has into a datastore, so when he leaves and rejoins he is still holding, now, if you want to save a tool, there are 2 scenarios, either the player is holding the tool, or he isnt, if he is holding it, it will be in his character, if he isnt it will be in his backpack (note the player will never be able to hold 1 tool at a time), so I use this code to detect whether the player is holding or not, and supposedly change a string variable to it:
local equipdee
if #player.Backpack:GetChildren() >0 then
equipdee = player.Backpack:FindFirstChildWhichIsA("Tool").Name
else
equipdee = player.Character:FindFirstChildWhichIsA("Tool").Name
end
then i use this code to save it into a data store:
local success, errormessage = pcall(function()
DS3:SetAsync(player.UserId.."-newequippedwand",equipdee)
end)
however when i rejoin, the variable has nothing in it!
