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

When does the Tool.Equipped:connect(function()end) event fire (And when doesn't it fire)?

Why is this code not working (It should be working):

Tool = script.Parent 
function equip()
	print("Equipped")
end

function unequip()
	print("Unequipped")
end

script.Parent.Equipped:connect(equip)
script.Parent.Unequipped:connect(unequip)

In script: StarterPack (StarterPack) Tool (Tool) OnEquiped (LocalScript)

When I equip the tool, I want to print the message "Equipped" to the Output. This for some weird reason does not seem to work.

2 comments

0

Is this script inside the tool in a local script?

0

Make sure the script is enabled.

2 answers

✓ Accepted answer

The tool has to have a Handle. It doesn't fire Equpped and Unequipped without it.

If you don't want a handle, then use a HopperBin.

Update: The following code (Executed through the console, while running the game in test mode) doesn't work either:

x = Instance.new("Tool")
x.Parent = game.Players.Player1.Backpack
x.Equipped:connect(function()print(":D")end)

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