I made an inventory save, but whenever equip the saved item it doesn’t pop up with my character holding the tool. Is this a roblox bug? There’s nothing wrong with my script so I wasn’t sure where to put this.
Does the tool appear on the tool list? Scripting isn’t my main focus neither I am really good at it but I’ll try to help.
Yes it does appear (30 characters)
So, I assume that your problem is when you equip it, the tool doesn’t show up neither the tool animation. In any part of the script, does the tool go to the workspace?
No it clones to the backpack from replicated storage.
Could you send me the script, please?
wait()
local ds = game:GetService("DataStoreService"):GetDataStore("TestTools")
game.Players.PlayerAdded:Connect(function(p)
if p then
local data
local success,fail = pcall(function()
data = ds:GetAsync(p.UserId)
end)
if success then
for i,v in pairs(data) do
print("Got data!")
if game.ReplicatedStorage:FindFirstChild(v) then
print("item found!")
game.ReplicatedStorage[v]:Clone().Parent = p.Backpack
print("Got tool!")
end
end
else
print("Didn't get tool!")
warn(fail)
end
end
end)
game.Players.PlayerRemoving:Connect(function(p)
if p then
local t = {}
for i,v in pairs(p.Backpack:GetChildren()) do
if v then
table.insert(t,v.Name)
end
end
local success,fail = pcall(function()
ds:SetAsync(p.UserId,t)
end)
if success then
print("Saved!")
else
print("Could not save!")
warn(fail)
end
end
end)
Your scripts looks right. Does the tool work on Starter Pack?
Yes (abcdefghijklmnopqrstuvwxyz)
Well, then when you get the tool, go to your player on Players, then Backpack, then open the tool and see if there’s something inside it.
Well, make sure the tool is unanchored, preferably CanCollide off so it doesn’t hit walls, and make sure there is a part called Handle, which is the part the character will hold.
Yes all of that is true for my tool.
Hmmm… I have no idea, then. Are you sure if the tool originally works on StarterPack? Like, are you able to hold it?
Yeah i can hold it. (30 Characters)
Well, uh- I’m sorry but I do not understand what’s the problem. I will go to studio and try to solve it.
That’s fine. Thanks for trying to help!
Yeah, then unfortunately, you will have to wait for someone to work on this case. I went to Studio and I couldn’t figure it out; I don’t know if your problem is the tool or script. Good luck on your game. Also, I have a suggestion for the tool; go into it’s properties and turn off CanBeDropped, so they can’t drop their tool.
Oh my gosh I made such a silly mistake! The tool in replicated storage wasn’t called “Handle”. Thanks for the help though! I really appreciate it!
Uh, don’t you mean the part inside the tool? The tool can be named anything, however, the part you want the character to hold has to be named exactly Handle
.