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

Tool Equipped event not firing?

Hierarchy goes like this:

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

repeat wait() until game.Players.LocalPlayer:WaitForChild("Character")~= nil

local tool = script.Parent
local aura = tool.Particles:FindFirstChild("AuraParticle")
local plr = game:GetService("Players").LocalPlayer
local char = plr:FindFirstChild("Character")
local la = char:FindFirstChild("Left Arm")
 local ra = char:FindFirstChild("Right Arm")

local function auraArms()
	print("Aura Arms activated!")
end

tool.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

✓ Accepted answer

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:

local player = game.Players.LocalPlayer 
if not player.Character then
	player.CharacterAdded:wait()
end
local character = player.Character

3 comments

0

I'll try this, if it works, you sir are getting an upvote.

0

It worked, thank you!

0

No problem :)

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