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: My elseifs aren't working?

Previous Thread :: Next Thread 
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:22 PM
while true do
for i = 1,60 do
TimeValue.Value = TimeValue.Value + 1
print(TimeValue.Value)

if minutes == 0 then do
finalamount = tostring(TimeValue.Value .. " seconds.")
game.Workspace.RealTime.Value = finalamount
wait(1)
end

elseif minutes == 1 then do
finalamount = tostring(Minutes .. " minute, " .. TimeValue.Value .. " seconds.")
game.Workspace.RealTime.Value = finalamount
wait(1)
end

elseif minutes ~= 0 or 1 then do
finalamount = tostring(Minutes .. " minutes, " .. TimeValue.Value .. " seconds.")
game.Workspace.RealTime.Value = finalamount
wait(1)
end

if TimeValue.Value == 60 then do
Minutes = Minutes + 1
TimeValue.Value = 0
a=tostring("Minutes------> " .. Minutes)
print(a)

end

end

end
end
end

--Okay, the issue is, when I run it, it still says minutes and 0 when I both are irrelevant. Getting no output.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:24 PM
elseif statements go inside the if statement and do not use ends to close them.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
28 Nov 2013 10:25 PM
remove end after the if's


if x then
elseif x then

not

if x then
end
elseif x then
end
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:27 PM
I did that, it says "end" expected to close "do" at line 10.
It persists even if I add the ends at the end.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:31 PM
http://wiki.roblox.com/index.php/In-Depth_Scripting_Guide#The_.27elseif.27_Statement

This will help a bit with clearing out ends.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:33 PM
while true do
for i = 1,60 do
TimeValue.Value = TimeValue.Value + 1
print(TimeValue.Value)

if minutes == 0 then
finalamount = tostring(TimeValue.Value .. " seconds.")
game.Workspace.RealTime.Value = finalamount
wait(1)

elseif minutes == 1 then
finalamount = tostring(Minutes .. " minute, " .. TimeValue.Value .. " seconds.")
game.Workspace.RealTime.Value = finalamount
wait(1)

elseif minutes ~= 0 or 1 then
finalamount = tostring(Minutes .. " minutes, " .. TimeValue.Value .. " seconds.")
game.Workspace.RealTime.Value = finalamount
wait(1)
end

if TimeValue.Value == 60 then
Minutes = Minutes + 1
TimeValue.Value = 0
a=tostring("Minutes------> " .. Minutes)
print(a)
end
end
end
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:33 PM
<--- I'm a wiki writer, I've already looked there.
:|
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
28 Nov 2013 10:34 PM
I'm loving this inefficiency.
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
28 Nov 2013 10:35 PM
Wow, they really let anyone become a wiki writer..
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:35 PM
I'm a newbie, I'm not going for efficient, I'm going for functional, in the least.
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:36 PM
Yeah, they don't accept just anyone.
Also, I didn't become a writer for scripting.
:P
The wiki isn't only scripting you know.
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
28 Nov 2013 10:36 PM
@Absurdism

I'd really love to be invited to Programmatic Sorcerers. *wink wink*
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:37 PM
Wiki writer? Surely you know how scopes and else/elseif/if statements work then, right?

Do they let everybody be a wiki writer?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:38 PM
late post
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
28 Nov 2013 10:38 PM
^
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:39 PM
Evolved, I'm only learning how to script.
:{

Wiki Writer ~= scipter
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
28 Nov 2013 10:39 PM
late post
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:39 PM
Can you guys just help me out with this script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
28 Nov 2013 10:41 PM
how long have you been a writer, anyway

We gave you help,
if
elseif
end

not
if
end
elseif
end
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:41 PM
ur dang rite they arent scipters

ok ok, but go review over those rough edges or whatever you want to call them, they're very important.
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
28 Nov 2013 10:41 PM
'if TimeValue.Value == 60 then do'


if TimeValue.Value == 60 then


That's your problem.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Nov 2013 10:42 PM
I just posted a hopefully fixed copy of your script up there a few minutes ago lol
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:43 PM
Okay, the ends in between them are moved, and I got with of the "do" after then.
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
28 Nov 2013 10:44 PM
oh, you did..
Report Abuse
dom2d2 is not online. dom2d2
Joined: 11 Apr 2008
Total Posts: 6397
28 Nov 2013 10:45 PM
@evolved, yours didn't fix anything.
The issue is I'm always getting the result as if minutes equaled more than 1.
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