Ge_inki
(Ge_inki)
August 11, 2021, 7:13am
#1
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)).lookVector 0.1)
lv = DA1.CFrame
DA1.CFrame = lv + ((lvCFrame.Angles(0,math.pi/2,0)).lookVector 0.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)).lookVector 0.1)
lv = DA1.CFrame
DA1.CFrame = lv - ((lvCFrame.Angles(0,math.pi/2,0)).lookVector 0.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
Ge_inki
(Ge_inki)
August 11, 2021, 7:59am
#3
I don’t know anything on scripting, what are variables?
Variables are those local
things that you store in the script.
Specifically
Ge_inki:
val = script.Parent.Parent.Open
val2 = script.Parent.Parent.Moving
DA2 = script.Parent.Parent.DoorA2
DA1 = script.Parent.Parent.DoorA1
Ge_inki
(Ge_inki)
August 11, 2021, 8:09am
#5
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?
Ge_inki
(Ge_inki)
August 11, 2021, 8:10am
#7
There is a lot of models and stuff.
Ge_inki
(Ge_inki)
August 11, 2021, 8:11am
#8
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?
Ge_inki
(Ge_inki)
August 11, 2021, 8:23am
#10
octav20071
(OctaViano)
August 11, 2021, 8:24am
#11
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.
Ge_inki
(Ge_inki)
August 11, 2021, 8:26am
#12
Yea I removed them because they stopped working, lemme add them and show you the updated one
Ge_inki
(Ge_inki)
August 11, 2021, 8:27am
#13
octav20071
(OctaViano)
August 11, 2021, 8:28am
#14
So what’s the problem? You are making me extremely confused.
Ge_inki
(Ge_inki)
August 11, 2021, 8:29am
#15
The gate is not working like when I put the model that on the script to work, it doesn’t work.
octav20071
(OctaViano)
August 11, 2021, 8:30am
#16
Make sure all of the children of the working model are named and the same in the not working model.
xE_th1n
(xE_th1n)
August 11, 2021, 8:30am
#17
Can you display a photo of your explorer?
Ge_inki
(Ge_inki)
August 11, 2021, 8:31am
#18
I did that but still the same error.
Ge_inki
(Ge_inki)
August 11, 2021, 8:31am
#19
xE_th1n
(xE_th1n)
August 11, 2021, 8:33am
#20
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”