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

How to disabled unequipped on a tool?

Asked by 5 years ago

If you disable CanBeDropped and the player press delete in keyboard the tool will be unequipped. So now how to prevent this?

0
i dont think you can you can make your own backpack mattchew1010 396 — 5y
0
But the backpack is not responsible of that? NiniBlackJackQc 1562 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago

My guess is you can add a ChildAdded event to backpack and check if the child is the tool you want to stay equipped, if it is then call Humanoid:EquipTool(Tool)

game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(Tool)
if Tool.Name == "ToolName" then --Replace ToolName by the tool's name
game.Players.LocalPlayer.Character.Humanoid:EquipTool(Tool)
end
end)
0
Tu parle francais?:3 NiniBlackJackQc 1562 — 5y
0
J'ai déjà essayé, mais on voit le tool se déséquiper et rééquiper, ça marche, mais c'est moche:/ NiniBlackJackQc 1562 — 5y
Ad
Log in to vote
1
Answered by
T1mes 230 Moderation Voter
5 years ago

You can unbind actions using ContextActionService and the function UnbindAction(). I’m guessing you would just unbind unequip.

Unfortunately I cannot go more into detail because I don’t have a computer with me at the moment. For more info go to https://wiki.roblox.com/index.php?title=API:Class/ContextActionService

Answer this question