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
11 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
11 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 — 11y
Ad
Log in to vote
0
Answered by 11 years ago
01local tool = TOOLPATHHERE -- Tool
02local player = PLAYERPATHHERE -- Player
03 
04player.Character.Humanoid:EquipTool(tool)
05tool.CanBeDropped = false
06 
07function equipAgain()
08    player.Character.Humanoid:EquipTool(tool)
09end
10 
11tool.Unequipped:connect(equipAgain)

Answer this question