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 from the player GUI?

Asked by
ItsMeKlc 235 Moderation Voter
9 years ago

I'm trying to tell when a player equips a tool. This is in the PlayerGui, not the tool... Nothing happens when I try it:

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
-2
Answered by 9 years ago

You need to put this script in starterplayerscripts, it works when I put it in staterplayerscripts.

0
Still doens't work for me.. .I have character auto-loads off... Does that have anything to do with it? ItsMeKlc 235 — 9y
0
I dont know. Try it with character auto-loads. connor12260311 383 — 9y
0
Although it is a better idea to put it in SPS, it won't do anything but make the loading faster. ChemicalHex 979 — 9y
0
thenwhy does it work for me? connor12260311 383 — 9y
Ad

Answer this question