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 » Scripters
Home Search
 

Re: Ending the game when....

Previous Thread :: Next Thread 
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
06 Mar 2015 09:32 PM
how would i make it where the game would end when the time runs out or when there is one player left?
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
06 Mar 2015 09:37 PM
Depends how you script it but it would probably be:

(TimeLeft ~= 0 or PlayersLeft ~= 1)
Report Abuse
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
06 Mar 2015 09:45 PM
i know that part Darkmist but like its kinda confusing, like how would i make it both, if that makes sense
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
06 Mar 2015 10:06 PM
keywords "and" and "or" can connect multiple values to an if statement.

so let's assume we are looking to end it:

TimeLeft = 0
PlayersLeft = 2

print(TimeLeft == 0 or PlayersLeft == 1) > true


TimeLeft = 0
PlayersLeft = 1

print(TimeLeft == 0 or PlayersLeft == 1) > true


TimeLeft = 10
PlayersLeft = 12

print(TimeLeft == 0 or PlayersLeft == 1) > false




Likewise "and" can be used to make sure both are equal to what you want, using parenthesis you can make very complex if statements in one line.


if (ValA and (ValB or ValC)) or ValD then
Report Abuse
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
10 Mar 2015 04:28 PM
Thanks i got it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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