Hello, I have this script where fire spreads along with other scripts. It's not a virus, but I can make buildings fall apart using my method. I made this script where on touch it clones into the part it touched. But the scripts and the fire get over-cloned and Studio crashes.The scripts and the fire get cloned way too much into a single brick. How do I make it so it would prevent it from over-cloning? I only want it to clone once.
local childs = script.Parent:GetChildren()
function onTouched(hit)
for i,v in pairs(childs) do
local clone = v:Clone()
clone.Parent = hit
end
end
script.Parent.Touched:connect(onTouched)

4 comments
There's multiple objects with multiple names. How do I make it find those other objects too?
If it finds one of the children in the object, then the other cloned objects will be there also, so the script should confirm whether or not it is already on fire and not add more fire if it's already on fire
I figured it out, but now I get error Unable to cast string to bool.
Oh wait, I did fix it, but now I get attempt to index nil with 'Parent'