Tornado not working after preventing it from taking building foundation

So, I took a freemodel tornado and edited the script so that it wouldn’t pick up my building foundation, but only the structure. I don’t know why, but it just stopped working after that. It worked fine before, then I took a break for a few months and it doesn’t work now. Here is the code:

local sp = script.Parent
repeat
	wait()
until sp:FindFirstChild("WhichTornado")
local tor = sp:FindFirstChild("WhichTornado").Value
local bp = sp:FindFirstChild("TornadoSuckingForce")

if not sp.ClassName == "UnionOperation" then
	sp.Anchored = false
	sp:BreakJoints()
	local height = 0
	if not bp or sp.Velocity.Magnitude < 2.5 then
		script.Parent:WaitForChild("SuckingRotation"):remove()
		bp:remove()
	end
	repeat
		bp.Position = (CFrame.new(tor.Position - Vector3.new(0, tor.Size.Y/2, 0))*CFrame.Angles(0,math.pi*2*((tick()/5)%1),0)*CFrame.new(tor.Size.X/2 + height/30, height, 0)).p -- the x will make the parts get farther away from the tornado, and y will make it move up
		height = height + (tor.Size.Y/100*0.5) -- aka 2% of it's Y size
		wait()
	until height == tor.Size.Y -- a very large number but it might fit the looks
	bp:remove()
	
	wait(5)
end

What errors is it showing in the output?

1 Like

Nothing, only failed to load sound errors,

When you say doesn’t work, do you mean doesn’t run at all, or doesnt do as you intended, by leaving the foundation and picking up the structure?

It simply just doesn’t pick anything up. Even things that aren’t UnionOperations

SP is the model of your structure?

Edit: i mean tornado

SP is the part that the script gets parented to, as the tornado has every part handle itself to reduce the workload. The tornado is tor.

1 Like

And how does it get parented to each part? from a different script?

Yeah, in a script that the script shown is parented to.

That script is called “Hazard” while the one shown is called “SuckingScript”

Hazard basically handles everything

1 Like

Can you post that script… i believe it isn’t parenting the script to any parts, and hence your issue.

It is getting parented, because once I remove the “if not sp.ClassName == "UnionOperation" then” it works fine.

1 Like

You said that SP is the script Hazard? so then sp.ClassName cant be a union

No, because Hazard parents SuckingScript to the parts surrounding the tornado. Also, it says if not not just if so it’s meant NOT to affect UnionOperations

I would edit your hazard script to not parent the sucking script to non unioned parts instead of this script.

Your hazard script is going to cycle through the parts in the workspace to decide which parts to clone the sucking script to, and handle it like that probably.

That also doesn’t work, but I came up with an idea. The tornado doesn’t pick up the ground, so if I just union the foundation with a piece of ground that’s invisible it shouldn’t pick it up.

1 Like