Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you equip a tool "customly"?

So upon removing ROBLOX's Default Core Guis, I had to create a new Tool gui for selecting tools. I made the system work for selecting the tools and such, but whenever I equip the tool, it always breaks. Even ROBLOX's default ones.

This is how I equip a tool into the character.

local plr = game.Playerse.LocalPlayer
Tool.Parent = plr.Character

Again, For some reason this seems to break the tool.

1 comment

1 answer

✓ Accepted answer

As GoldenPhysics said, and as I said yesterday, you can use the :EquipTool() function of Humanoid.

To Unequip the tools you can use the :UnequipTools() function of Humanoid.

local Player = game.Players.LocalPlayer
repeat wait() until Player.Character -- Wait for players character to load
local Character = Player.Character

local Humanoid = Character:WaitForChild("Humanoid")

local Gun = game:GetService("ReplicatedStorage"):WaitForChild("Gun")

Humanoid:EquipTool(Gun) -- EquipTool function  does not work on NPC characters.

wait(5)

Humanoid:UnequipTools()

Please don't duplicate your questions.

1 comment

0

thank you very much! you did not have to downvote me by the way...

This discussion is preserved as it was. New answers, comments, and votes are closed.