Hey there! I’m Noah, and I’m trying to create an order system for a group. Right now, I’m trying to create a system where if you hold out an item and click “Add Item,” it will remove it from your inventory and put it into a folder called “storage” (player > storage) where it can be given to the player when you press “submit.” I’m having trouble with it because, on the server-side, it says that it’s not able to find the tool (shown below), while in my local script, it can find it.
Local script:
I have tried character:FindFirstChildWhichIsA("Tool"), but that has shown the exact same output as the method I’m currently using now. I have double-checked that the tool is under the player’s character, which it is, and I am very confused as to why it isn’t working.
Mk… Might your tool be in the backpack rather than your storage?
its hard for me to determine what storage[1] and storage[2] is so if you can show a sample of that itd be amazing, in other words, what are you trying to index on the server side?
ok I see your problem, you are most likely replicating a name rather than an object to the server, so that all server has is a string, which means that it doesn’t know what that string is going to
local tool = game:GetService('Players'):FindFirstChild(plr.Name).Character:FindFirstChild(storage[2])
if that doesnt work, we’ll try to locate their character first and run a for loop to try return any tools thats there, do let me know before proceeding
Ive never tried to parent an equipped tool directly to another place…
Try unequip their tool first so that the tool ends up in player’s backpack, and move the tool from the backpack to the Storage folder. To do that, you can do
game.Workspace[plr.Name]:FindFirstChild('Humanoid'):UnequipTools()
local tool = game.Players:FindFirstChild(plr.Name).Backpack:FindFirstChild(storage[2])
edit: im on a school computer which blocked discord and my current location isnt giving me the greatest signal for cellular data
Hey there! I just found what was wrong:
I didn’t realize that if you were on the client and were using the command bar, it would run the script locally, which was the big problem. Thank you so much for helping though.