This question is the result of me trying to edit a working script that was answered by Torren_Mr (thank you) with more unions but it ultimately just did either the same thing or nothing. Here's the script:
local ClickHere = script.Parent.Parent.ClickHere
local PlateEmp = script.Parent.Parent.PlateEmp
local PlateInv = script.Parent.Parent.PlateInv
local Plate1 = script.Parent.Parent.Plate1
local Plate2 = script.Parent.Parent.Plate2
local Plate3 = script.Parent.Parent.Plate3
function click()
if PlateInv.Transparency == 1 then
PlateInv.Transparency = 1
PlateEmp.Transparency = 0
Plate1.Transparency = 1
Plate2.Transparency = 1
Plate3.Transparency = 1
elseif PlateEmp.Transparency == 0 then
PlateInv.Transparency = 1
PlateEmp.Transparency = 1
Plate1.Transparency = 0
Plate2.Transparency = 1
Plate3.Transparency = 1
elseif Plate1.Transparency == 0 then
PlateInv.Transparency = 1
PlateEmp.Transparency = 1
Plate1.Transparency = 1
Plate2.Transparency = 0
Plate3.Transparency = 1
elseif Plate2.Transparency == 0 then
PlateInv.Transparency = 1
PlateEmp.Transparency = 1
Plate1.Transparency = 1
Plate2.Transparency = 1
Plate3.Transparency = 0
elseif Plate3.Transparency == 0 then
PlateInv.Transparency = 1
PlateEmp.Transparency = 1
Plate1.Transparency = 1
Plate2.Transparency = 1
Plate3.Transparency = 1
end
wait(2)
end
script.Parent.ClickDetector.MouseClick:Connect(click)
Can there be multiple "elseif" statements in a script and can they be in a sequential, looping order?
I am trying to make this script turn all unions besides one invisible, and when the player clicks the Click Detector, the next union in the pattern transparency turns to 0 while the previous goes to 1 and vice versa with all the unions.
Also, if you look at the script from top to bottom, that is the pattern I am trying to complete. (With "PlateInv" always invisible or transparency = 1)
(PlateInv -> PlateEmp -> Plate1 -> Plate2 -> Plate3 -> Back to PlateInv)
Please be as specific and/or simple as you can since I am not good at scripting or the understanding of lua that well. Sorry for asking so many questions based one problem, I am just very confused.

1 comment
If it works, then yeah.