Inside this local script (which is inside a tool). I am trying to make so that if a certain slide 33410686 visibility false, the visibility returns to true if 272387517. So I put in this If statement from line 14 to line 20 and it doesn't seem to work.. any help?
local sn = 1
local slides = {33410686, 272387517}
function rotate()
sn = sn + 1
if sn > #slides then sn = 1 end
script.Parent.Image = "http://www.roblox.com/asset/?id=" .. slides[sn]
end
---- Doesn't work V V V
if script.Parent.Image == "http://www.roblox.com/asset/?id=33410686" then
script.Parent.Image.Visible = false
elseif script.Parent.Image == "http://www.roblox.com/asset/?id=272387517" then
script.Parent.Image.Visible = true
end
---- Doesn't work ^ ^ ^
for i=1,#slides do
rotate()
end
script.Parent.MouseButton1Click:connect(rotate)

1 comment
You only used it once before the function was called...