Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do you equip a tool "customly"?

Asked by 7 years ago

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 answer

Log in to vote
1
Answered by
AZDev 590 Moderation Voter
7 years ago

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.

0
thank you very much! you did not have to downvote me by the way... laughablehaha 494 — 7y
Ad

Answer this question