Need script support

So I have a script but I want it on another model, and when I put it on the other model it won’t work this is the script :
val = script.Parent.Parent.Open

val2 = script.Parent.Parent.Moving

DA2 = script.Parent.Parent.DoorA2

DA1 = script.Parent.Parent.DoorA1

function onC()

if val2.Value == false then

if val.Value == false then

val2.Value = true

for i = 1, (DA1.Size.X*10)-10 do

wait(0.01)

lv = DA2.CFrame

DA2.CFrame = lv + ((lvCFrame.Angles(0,-math.pi/2,0)).lookVector0.1)

lv = DA1.CFrame

DA1.CFrame = lv + ((lvCFrame.Angles(0,math.pi/2,0)).lookVector0.1)

end

val2.Value = false

val.Value = true

else

val2.Value = true

for i = 1, (DA1.Size.X*10)-10 do

wait(0.01)

lv = DA2.CFrame

DA2.CFrame = lv - ((lvCFrame.Angles(0,-math.pi/2,0)).lookVector0.1)

lv = DA1.CFrame

DA1.CFrame = lv - ((lvCFrame.Angles(0,math.pi/2,0)).lookVector0.1)

end

val2.Value = false

val.Value = false

end

end

end

script.Parent.ClickDetector.MouseClick:connect(onC)

Did you change the variables to match the other model?

If you did just re-do them to check it’s all correct

I don’t know anything on scripting, what are variables?

Variables are those local things that you store in the script.
Specifically

I tried and now it doesn’t work I even tried putting the other model instead of Door A1

Can you show your explorer, please?

There is a lot of models and stuff.

https://gyazo.com/f815b92d52482c15f18e8380bc5097e8

The bollard is the other model

I don’t get it. Can you show us the childs of the model that the script works on, and the one that the script doesn’t?

https://gyazo.com/09ca1f332bd0b5569f4efd40e7b843be
https://gyazo.com/ad24baf74b031c4d3a4dcefedd363272

They are clearly not the same model. The script is not working because it’s variables are nil! You need to make sure the content that the script wants should be there.

Yea I removed them because they stopped working, lemme add them and show you the updated one

https://gyazo.com/7c4292a331497bdd8a3d9e80374de7e2

So what’s the problem? You are making me extremely confused.

The gate is not working like when I put the model that on the script to work, it doesn’t work.

Make sure all of the children of the working model are named and the same in the not working model.

Can you display a photo of your explorer?

I did that but still the same error.

https://gyazo.com/d329de309e344f7a5b4f7c7c45a6218d

Where is the script located? Also I’d suggest actually learning to script, or at least the basics of it because that script is “scuffed”