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

Tool Equipped event not firing?

Asked by 8 years ago

Hierarchy goes like this:

-Tool -Script -Particles (THIS IS A FOLDER!) -AuraParticle

01repeat wait() until game.Players.LocalPlayer:WaitForChild("Character")~= nil
02 
03local tool = script.Parent
04local aura = tool.Particles:FindFirstChild("AuraParticle")
05local plr = game:GetService("Players").LocalPlayer
06local char = plr:FindFirstChild("Character")
07local la = char:FindFirstChild("Left Arm")
08 local ra = char:FindFirstChild("Right Arm")
09 
10local function auraArms()
11    print("Aura Arms activated!")
12end
13 
14tool.Equipped:connect(auraArms)

It just doesn't want to do anything, no errors are in the output either. The tool doesn't have require a handle so that property is false, and that's really the only thing I changed in the properties of the tool.

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

Character is not a child of LocalPlayer, but is rather a property. Therefore your WaitForChild call will most likely never stop yielding. If you want to wait until the character is added, you could do something like this:

1local player = game.Players.LocalPlayer
2if not player.Character then
3    player.CharacterAdded:wait()
4end
5local character = player.Character
0
I'll try this, if it works, you sir are getting an upvote. Strykebyte 45 — 8y
0
It worked, thank you! Strykebyte 45 — 8y
0
No problem :) BlackJPI 2658 — 8y
Ad

Answer this question