Hi!
I have a separate folder for each type of tools in which they are stored. When I equip a tool through a script, it cannot take it normally - the hand is raised and there is no tool, it does not work.
Is there a way to equip tool so that it does not lie in a backpack but in a different folder?
P.S I know about :EquipTool but if the item is not inside player backpack folder its not working.
Thanks)
After testing, I found that :EquipTool() will work if you parent it to the Player's Backpack then run :EquipTool().
1 | local Tool = Tool |
2 | Tool.Parent = Player.Backpack |
3 | Humanoid:EquipTool(Tool) |
This also applies to parenting it to the Character:
1 | local Tool = Tool |
2 | Tool.Parent = Player.Backpack |
3 | Tool.Parent = Player.Character |
Don't know why that is the case, but it is.
in lighting, put the tools in a folder called "Tools", lets say you have a tool called weapon1, this is the script
local script
1 | -- This clones the weapon from "Lighting" to the players backpack |
2 | game.Lighting.Tools.weapon 1 :Clone().Parent = game.Players.LocalPlayer.Backpack |