I’ve created a script to clone and then remove the particle, but the particle does not work.
Output: attempt to index nil with ‘GetChildren’
I can’t figure what what’s going wrong
script.Parent.Parent.MeleeDamage.OnServerEvent:Connect(function(player)
local function TargetPlayer(hit)
humanoid = hit.Parent:FindFirstChild("Humanoid")
torso = hit.Parent:FindFirstChild("UpperTorso")
local tag = Instance.new("ObjectValue")
tag.Value = player
tag.Name = "creator"
tag.Parent = humanoid
game:GetService("Debris"):AddItem(tag,5)
end
script.Parent.Parent.Parent.Hitbox.Touched:Connect(TargetPlayer)
if humanoid then
humanoid:TakeDamage(35)
print("Damaged")
end
humanoid = nil
script.Blood:Clone().Parent = torso
wait(0.1)
for i,v in pairs(torso:GetChildren()) do
if v:IsA("ParticleEmitter") then
v:Destroy()
print("Destroyed")
end
end
end)
Anyways, thanks and stay safe!