|
| 22 Jun 2012 07:54 AM |
Output : Workspace.CodeInput.Part.Script:13: 'end' expected (to close 'if' at line 5) near 'else'
local decal = script.Parent.Decal
script.Parent.ClickDetector.MouseClick:connect(function()
if decal.Texture == "http://www.roblox.com/asset/?id=84290673" then do decal.Texture = "http://www.roblox.com/asset/?id=84290706" end
else if decal.Texture == "http://www.roblox.com/asset/?id=84290706" then decal.Texture = "http://www.roblox.com/asset/?id=84290719" end
else if decal.Texture == "http://www.roblox.com/asset/?id=84290719" then decal.Texture = "http://www.roblox.com/asset/?id=84290687" end
else if decal.Texture == "http://www.roblox.com/asset/?id=84290687" then decal.Texture = "http://www.roblox.com/asset/?id=84290746" end
else if decal.Texture == "http://www.roblox.com/asset/?id=84290746" then decal.Texture = "http://www.roblox.com/asset/?id=84290673" end
end script.Parent.ClickDetector.MouseClick:connect(onClicked)
end)
|
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 22 Jun 2012 07:56 AM |
local decal = script.Parent.Decal
script.Parent.ClickDetector.MouseClick:connect(function()
if decal.Texture == "http://www.roblox.com/asset/?id=84290673" then do decal.Texture = "http://www.roblox.com/asset/?id=84290706"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290706" then decal.Texture = "http://www.roblox.com/asset/?id=84290719" end
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290719" then decal.Texture = "http://www.roblox.com/asset/?id=84290687"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290687" then decal.Texture = "http://www.roblox.com/asset/?id=84290746"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290746" then decal.Texture = "http://www.roblox.com/asset/?id=84290673" end
end)
|
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 07:56 AM |
You don't need an end after every elseif.
local decal = script.Parent.Decal
script.Parent.ClickDetector.MouseClick:connect(function()
if decal.Texture == "http://www.roblox.com/asset/?id=84290673" then do decal.Texture = "http://www.roblox.com/asset/?id=84290706"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290706" then decal.Texture = "http://www.roblox.com/asset/?id=84290719"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290719" then decal.Texture = "http://www.roblox.com/asset/?id=84290687"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290687" then decal.Texture = "http://www.roblox.com/asset/?id=84290746"
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290746" then decal.Texture = "http://www.roblox.com/asset/?id=84290673" end
end script.Parent.ClickDetector.MouseClick:connect(onClicked)
end) |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 07:57 AM |
Stop F5ing your threads :/ It doesn't make you get an answer any sooner. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 22 Jun 2012 07:58 AM |
| I regret that i helped F5'ing noob. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 08:01 AM |
Okay, then.
Workspace.CodeInput.Part.Script:9: 'end' expected (to close 'do' at line 5) near 'elseif'
:P |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 08:51 AM |
Remove the do.
And I am pretty sure you need ends for elseifs but I might be wrong,
~thedestroyer115, master RPG maker~ |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:10 AM |
@Destroyer115
LOL WUT?
You don't need an 'end' for 'elseif's. It's only for the start of an if statement you need one. Exmaple;
num=1 while wait() do if 1+num=2 then num=num+1 elseif 1+num=3 then num=num-2 end end
See? 2 'ends'. One for the 'while wait() do', and one for the 'if' statement.
--TehChikenHater ლ(ಠ_ಠლ) |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:37 AM |
| I said I might be wrong. :| |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 22 Jun 2012 09:51 AM |
@thedestroyer
Nah, you can say do after that. Some people do that. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Jun 2012 10:04 AM |
local decal = script.Parent.Decal
script.Parent.ClickDetector.MouseClick:connect(function()
if decal.Texture == "http://www.roblox.com/asset/?id=84290673" then decal.Texture = "http://www.roblox.com/asset/?id=84290706" end
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290706" then decal.Texture = "http://www.roblox.com/asset/?id=84290719" end
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290719" then decal.Texture = "http://www.roblox.com/asset/?id=84290687" end
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290687" then decal.Texture = "http://www.roblox.com/asset/?id=84290746" end
elseif decal.Texture == "http://www.roblox.com/asset/?id=84290746" then decal.Texture = "http://www.roblox.com/asset/?id=84290673" end
end script.Parent.ClickDetector.MouseClick:connect(onClicked)
end)
-- im maybe no scripter but i think this will work |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 10:07 AM |
| Thank you miz for correcting me in a kind manner. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 10:32 AM |
| Whats with the do on the first conditional statement???? |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 10:33 AM |
| Do needs an end. Your script does not need do. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 05:25 PM |
if (not nil or false) then do
Doesn't make since Do this:
if (not nil or false) then
elseif (not nil or false) then
end |
|
|
| Report Abuse |
|
|