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

How do I make a tool "locked"?

Asked by
wddd89 35
10 years ago

So, I was wondering on how to make a tool in which you can never de-tool it once you have equipped it. Even better, have it equipped from the start. Help is greatly appreciated. thanks.

2 answers

Log in to vote
2
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago

There's a method to force equip a tool, it's called EquipTool. It's the same thing as parenting the tool to your character.

There's also a property in the tool called 'CanBeDropped' that you can tick off, which won't allow players to drop it. However, if never want the player to be able to put it away, you'd need to weld the handle to your player.

0
Thanks a bunch. wddd89 35 — 10y
Ad
Log in to vote
0
Answered by 10 years ago
local tool = TOOLPATHHERE -- Tool
local player = PLAYERPATHHERE -- Player

player.Character.Humanoid:EquipTool(tool)
tool.CanBeDropped = false

function equipAgain()
    player.Character.Humanoid:EquipTool(tool)
end

tool.Unequipped:connect(equipAgain)

Answer this question