The only mistake in your code is that you are trying to use booleans with objects since it's not a bool value(I think it's a particle right??).You also didn't declare Torso.I would type my code like this:
By the way, this is a Server Script in ServerScriptService or in Workspace
game.Players.PlayerAdded:Connect(function(player)
local char = player.Character
local Torso = char:FindFirstChild("Torso")
if Torso:FindFirstChild("Aura") then
local aura = Torso:WaitForChild("Aura")
aura:Destroy()
else
print("Torso is nil and cannot find Aura")
end
end)
I don't understand what you mean by "Aura" if it's nil or not.
But if the Server Script does not work,
Here is an alternative:
This is a Local Script and put it in StarterGui
Here is the alternative code:
local player = game.Players.LocalPlayer
local char = player.Character
local torso = char:FindFirstChild("Torso")
local aura = torso:WaitForChild("Aura")
if aura then
aura:Destroy()
else
return print("Aura is nil")
end
If this answer helped then,
Please accept,
If you have any questions or if both of these scripts didn't work,
please type in any question you want.
1 comment
Please make your question name more about the question. Your question is not about deleting particles, it is about checking them.