generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: /*/*/ Quick Fix /*/*/

Previous Thread :: Next Thread 
LightedRoblox is not online. LightedRoblox
Joined: 16 Apr 2010
Total Posts: 6235
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 is not online. 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
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
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
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
22 Jun 2012 07:57 AM
Stop F5ing your threads :/
It doesn't make you get an answer any sooner.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Jun 2012 07:58 AM
I regret that i helped F5'ing noob.
Report Abuse
LightedRoblox is not online. LightedRoblox
Joined: 16 Apr 2010
Total Posts: 6235
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
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
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
22 Jun 2012 09:37 AM
I said I might be wrong. :|
Report Abuse
miz656 is not online. 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 is not online. 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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
22 Jun 2012 10:07 AM
Thank you miz for correcting me in a kind manner.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
22 Jun 2012 10:32 AM
Whats with the do on the first conditional statement????
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
22 Jun 2012 10:33 AM
Do needs an end. Your script does not need do.
Report Abuse
thejonathann is not online. thejonathann
Joined: 14 Dec 2010
Total Posts: 76
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image