Hi im trying to make a script that destroys the players trail when the click unequip.
Ive looked online but my code looks completely different to anyone elses when putting the trail onto the character.
local character = player.Character
task.wait()
local Head = character:FindFirstChild('Head') -- will wait until the head is loaded, at that time the code below will be yielded by this function, using waitforchild on something that doesnt exist will yield infinitely
local Torso = character:FindFirstChild('Torso')
local LowerTorso = character:FindFirstChild('LowerTorso') -- both has waistbackattachment
local plrTrail = Trail:Clone()
if Torso then
plrTrail.Parent = Torso
plrTrail.Attachment1 = Torso.WaistBackAttachment
elseif LowerTorso then
plrTrail.Parent = LowerTorso
plrTrail.Attachment1 = LowerTorso.WaistBackAttachment
end
plrTrail.Attachment0 = Head.FaceFrontAttachment
if clicks == 2 then
clicks = 0
equip.Text = "Equip"
plrTrail:Destroy()
end
end)
I assumed that i’d just do PlrTrail:destroy() but this doesnt work.
Any ideas? thankyou