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 |
|
|
|
| 06 Mar 2015 09:37 PM |
Depends how you script it but it would probably be:
(TimeLeft ~= 0 or PlayersLeft ~= 1) |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 05 Apr 2013 |
| Total Posts: 1304 |
|
| |
|