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

How to make a tool unequippable?

Asked by 7 years ago

So I'm having trouble trying to script this out, but if someone gives me an idea how to do it, I may be able to do this! Thank you!

1 answer

Log in to vote
1
Answered by 7 years ago

So on the Roblox Wiki there is a small section on forcing the player to Unequip a tool

http://wiki.roblox.com/index.php?title=API:Class/Humanoid/UnequipTools

There is the link.

If you are sorta new to scripting youll notice it says "void" next to it, dont put that part into your code. Void means you use a : to tell the code to use that.

For example

-- Notice I used : to connect the function. 
game.Players.PlayerAdded:connect(function(player)
    if player.Character:WaitForChild("Humanoid") then
        player.Character.Humanoid:UnequipTools
    end
end

Was this short block of code will basically do is unequip tools from the player when they are added to the game. You could add a wait for Humanoid... Infact let me do that or this may error.

So the script waits for a player to join, when a player does join it waits for the humanoid if it finds a humanoid it then unequips there tools.

I hope this helped if you have any questions please ask. I am not the best scripter but I am learning so forgive me if this doesnt work.

Ad

Answer this question