Where to put a Backpack (or other class) for Models (that have Humanoid) that are not being controlled by Player, so Humanoid:UnequipTools() would put Tools to that zone?
Not sure if you can do that. This is probably some behaviour that you’d have to make yourself
How do I? Are there editable scripts for Tool behaviour?
It sounds like you have an NPC that uses a tool and want a way to take the tool away from that NPC while preserving it for future use. If that’s the case, you could create a folder in ServerStorage dedicated to that NPC which their unequpped tools could be parented to.
You could also always just destroy that tool and give them a new copy when the time comes.
Well yes, how do I make Humanoid:UnequipTools() put them to, well, somewhere? (put them in nil at the moment)
Humanoid:UnequipTools() is a Roblox method. You cannot change its behavior in any way. You have to use your own function for this.
Try something like this:
-- Create a folder for the tools
-- You don't have to do this via code
local myNPCToolBackpack = Instance.new("Folder")
myNPCToolBackpack.Parent = game.ServerStorage
myNPCToolBackpack = "Name of NPC" -- You can name it whatever you want, I would suggest a unique name for each NPC
local function unequipNPCTools(NPC : Instance, newParent)
for _, v in pairs(NPC:GetChildren()) do --or NPC:GetDescendants if the tools are not guaranteed to be a direct child of NPC
if not v:IsA("Tool") then continue end -- If the current instance is not a tool, skip it
v.Parent = newParent -- Set the tool to the new Parent
end
end
-- Example usage
unequipNPCTools(myNPC, myNPCToolBackpack)
This function will loop through all the passed NPC’s children and set the tools’ parent to the location specified in the second parameter. This should work no matter how many tools are currently children of the NPC.
sadly roblox limiting and their presets wont allow us to add npcs to have backpacks for tools. You have to do a wacky workaround by placing folders in your server storage for them.
Hopefully roblox
That’s really sad that Roblox does not let devs change how things work, especially when a lot of them aren’t working as needed.