You have parts stored in the ignore list by name and you probably have multiple parts of the same name and they’ll all count as ignored.
Store them as IGNORE_LIST[Object] = true and then to check if it’s ignored just check IGNORE_LIST[Object]
You have parts stored in the ignore list by name and you probably have multiple parts of the same name and they’ll all count as ignored.
Store them as IGNORE_LIST[Object] = true and then to check if it’s ignored just check IGNORE_LIST[Object]
There’s nothing stored in the ignore list, And even when I tried putting this right after "Rocket.Touched:Connect(Function(TOuchPart), Still not working…
Is there a script which I can just put inside the model which will destroy his children if blew up?
The Destroy() function calls itself on all of the children of the object you called it on, destroying all of its descendants.
Then what’s wrong with the code…?
if ExplodeEvent then
Rocket.Touched:Connect(function(TouchPart)
delay(7, function()
TouchPart:Destroy()
end)
if not IGNORE_LIST[string.lower(TouchPart.Name)] and not TouchPart:IsDescendantOf(Character) then
ExplodeEvent:FireServer(Rocket.Position)
if callFunction == false then
callFunction = true
LocalTouchSound:play()
wait(0.5)
callFunction = false
end
end
end
)end
end
You’re trying to have the model destroyed, yes? Is at least the touch part being destroyed?
The touch parts, All parts that are touched by the explosion.
Is at least the touch part being destroyed?
When I look closely, Both my hand and one single part out of all fallen parts is being destroyed…
I believe your destroy function is run before the whitelist checker.
if ExplodeEvent then
Rocket.Touched:Connect(function(TouchPart)
if not IGNORE_LIST[string.lower(TouchPart.Name)] and not TouchPart:IsDescendantOf(Character) then
delay(7, function()
TouchPart:Destroy() -- moved it here
end)
ExplodeEvent:FireServer(Rocket.Position)
if callFunction == false then
callFunction = true
LocalTouchSound:play()
wait(0.5)
callFunction = false
end
end
end
)end
That’s what I did before, Now my hand is not being destroyed, But only one part is being destroyed.
Switch it from Touch:Destroy to Touch.Parent:Destroy()
Then it will destroy the whole model…
I only want to destroy the parts that are no longer connected to the rest of the buildings, The parts that were affected by the explosion and fell off.
That’s also an option, But then I will have to put the script in every single part…
Where are you doing the explosion?
In the rocket launcher script, Local script
You should do the explosion on the server so other clients can see it.
I’m not sure where the explosion is, The rocket launcher is a free model, But I think it’s on the server…
It’s only talking about damaging humans, The rocket launcher destroyed the first part fine, I just need a way for it to destroy all other parts that fell…