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

How to tell when a player equips a tool?

Asked by
ItsMeKlc 235 Moderation Voter
9 years ago

How can I tell when a player equips a tool? I've tried this, but nothing happens:


local character = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) character.DescendantAdded:connect(function(descendant) if descendant.ClassName == "Tool" then print("Tool") end end)

1 answer

Log in to vote
1
Answered by 9 years ago

you can use the Equipped event.

local tool = script.Parent

tool.Equipped:connect(function()
print("Tool Equipped")
end)

If you're checking to see if a certain player has equipped the tool, then you can include a conditional in the equipped script to check the name of the person who equips it.

0
I don't want to put the script in a tool ItsMeKlc 235 — 9y
0
where do you want it? aquathorn321 858 — 9y
0
PlayerGui ItsMeKlc 235 — 9y
Ad

Answer this question