Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

whats wrong with this if statement (GUI related)?

Asked by
Xl5Xl5 65
8 years ago

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)
0
You only used it once before the function was called... M39a9am3R 3210 — 8y

Answer this question