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: elseif

Previous Thread :: Next Thread 
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 08:48 AM
Supposed to teleport player to one place if the first if is true, and another place if the first is false, and the second is true. It always does the second one even if the first value is true

if workspace.TR1.InUse.Value == false then
--teleportation code
elseif workspace.TR2.InUse.Value == false then
--teleportation
elseif workspace.TR3.InUse.Value == false then
--tele code
end
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 08:54 AM
bump
Report Abuse
EventLegoh is not online. EventLegoh
Joined: 15 Oct 2011
Total Posts: 46
29 Oct 2011 08:59 AM
if workspace.TR1.InUse.Value == false then
--teleportation code
if workspace.TR2.InUse.Value == false then
--teleportation
if workspace.TR3.InUse.Value == false then
--tele code
end
end
end


you might have to add on a few more ends, or take some off, just check the output. im still a little guessy on if then ends.
and, this script may not work, i think it will though
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:06 AM
no didn't work
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:07 AM
bump
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:07 AM
bump
Report Abuse
churroboy is not online. churroboy
Joined: 20 Aug 2008
Total Posts: 2231
29 Oct 2011 09:11 AM
The answer is not making a new thread. That is spam.

Your explanation is too vague.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:15 AM
Ok smart one, tell me what else I need to tell you, I put another one up because for some reason people respond to 'Need an answer' more that 'elseif'
and since roblox always shows your posts on the front page, you never know when it dies.
Report Abuse
churroboy is not online. churroboy
Joined: 20 Aug 2008
Total Posts: 2231
29 Oct 2011 09:17 AM
"If the first if is true" is too vague.

If the first expression evaluated to true, then the first block would run and the rest would be skipped.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:25 AM
Ok here:
if workspace.TR1.InUse.Value == false then
--tele code
elseif workspace.TR2.InUse.Value == false then
--tele code
else if workspace.TR3.InUse.Value == false then
--tele code
end
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:27 AM
Oh wait, you meant the first part, not the script.

If TR1.InUse.Value ~= false then player is supposed to teleport there, if not it moves onto TR2, if TR2.Value ~= false also then it teleports you to TR3
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:32 AM
bump
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:34 AM
Wouldn't be asking this if there was more lua documentation, so thumbs up for more documentation.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 09:37 AM
come on, don't quit on me.
Report Abuse
churroboy is not online. churroboy
Joined: 20 Aug 2008
Total Posts: 2231
29 Oct 2011 09:43 AM
Lua.org has good documentation.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Oct 2011 10:00 AM
if not workspace.TR1.InUse.Value then
--tele code
elseif not workspace.TR2.InUse.Value then
--tele code
elseif not workspace.TR3.InUse.Value then
--tele code
end
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Oct 2011 10:02 AM
If that does not work, then you are either not using this correctly; you made an error in the 'tele code' areas; or you made a mistake setting up your BoolValues.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
29 Oct 2011 04:46 PM
I feel stupid, I accidentaly put the change value to true before the tele code.
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