How can I make when I equip a tool a part becomes a child of the character

How can I make when I equip a tool a part becomes a child of the character. For more context, I would like when I equip a tool the particle emitter becomes a child of my left hand.

1 Like

I don’t know about scripting tools, so this isnt the best way to make it, but see if this works

local PE = particle emitter path or instance.new
local char = game.Players.LocalPlayer.Character
while true do
   wait()
   if char:FindFirstChild(tool name) then
      if char.LeftHand:FindFirstChild(particle emitter name) then
      else
         PE.Parent = char.LeftHand
      end
   else
      if char.LeftHand:FindFirstChild(particle emitter name) then
         PE:Destroy()
      end
   end
end
1 Like

Ok thank you I will try it out

1 Like

I found an error, try use the new script (I edited the other)

1 Like

Ok :grinning: :grinning: :grinning:

1 Like

Instead of constantly checking if the tool is parented to the character, just use the Equipped and Unequipped events of a tool.

Thats why I said this, I know this commands but I never used then so, i don’t know if I should said this if I don’t know the result.

local PE = game.ServerStorage.Apprentice
local char = game.Players.LocalPlayer.Character
while true do
	wait()
	if char:FindFirstChild("TryOn") then
		if char.LeftHand:FindFirstChild("Apprentice") then
		else
			PE.Parent = char.LeftHand
		end
	else
		if char.LeftHand:FindFirstChild("Apprentice") then
			PE:Destroy()
		end
	end
end

Is that how It should be?

1 Like

yea, see if the script works fine.

Ok I will try :thinking: :grinning:

1 Like

It does not work but I have a script to put it in

script.Parent.Equipped:Connect(function()
end)

script.Parent.Unequipped:Connect(function()
end)
1 Like

ok, so try it and see if works

I was thinking I could make it like when the tool is equipped the part would become a child of the players left hand but I dont know how to clone it and make it a child

1 Like

like…

particleemitter:Clone()
particleemitter.Parent = char.LeftHand

ok thanks for helping I will try it

1 Like

Ok so when the player unequips the tool I can just say

particleemitter:destroy()
1 Like

Yea, this will delete the particles
But make sure to say again wheres the particles to the script

ok :grinning: :grinning: :grinning:

1 Like