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

Is it possible to prevent a player from unequipping a tool?

I want this because if I put my tool away while using it, it results in an error, a way to stop it erroring would also be an acceptable answer.

3 comments

0

There's a property on tools that says something along the lines of "CanBeDropped" un-tick it.

0

That's not what I want, I want to make it so it's impossible to unequip the tool while using it, not drop it. I don't know if this is even possible, I'm asking if it is.

0

You could always weld whatever you are using on your character. However, this means that you aren't handling with tools anymore.

1 answer

I don't know of any other way other than a loop. So lets do this:

while true do
	wait()
	if game.Players.LocalPlayer.Backpack:FindFirstChild("RocketLauncher") 
		then game.Players.LocalPlayer.Backpack.RocketLauncher.Parent = game.Players.LocalPlayer.Character
		end
	end

Replace "RocketLauncher" with your tool name. When a tool enters the players character, the character equips it.

You may still receive an error because the player is able to de-equip the tool, however this is less than a second.

While making this loop in studio, I was only able to get it to work when using "FindFirstChild" Other more conventional methods exists.

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