|
| 11 Oct 2014 05:53 PM |
There are no errors in output. It just doesn't work. At first I was scared because I didn't know if my studio would crash or not. Finally I worked up the courage to Enable the script and bam, nothing happens. At all.
The entire point of this function is to check to see how many players have an object called MissionReady in them, and then add them to the number count. Obviously this function is supposed to loop, but I can't use a while true loop because this function will be holding other very important functions on the "--Function Here" line.
What it's supposed to do is repeat a check of all players until there are at least 2, 3, or 4 players ready to play (depending on voted game mode and team numbers), and then run the game set up function (We can just call it Setup() for now)
NumberOfTeams = game.ServerStorage.NumberOfTeams GameplayType = game.ServerStorage.GameplayType
function Inquiry() local NumberOfReadyPlayers = 0 local ReadyPlayers = game.Players:GetChildren() for o = 1, #ReadyPlayers do wait() if ReadyPlayers[o]:findFirstChild("MissionReady") then NumberOfReadyPlayers = NumberOfReadyPlayers + 1 print(NumberOfReadyPlayers) else Inquiry() end end --Function Here end Inquiry() |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 11 Oct 2014 06:34 PM |
| Make a function that gets and returns the number of players with the thing, and whenever normally use NumberOfReadyPlayers use the function |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 06:39 PM |
| That's exactly what I'm trying to do. I did everything I could think of and failed. That's why I posted about it here. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 11 Oct 2014 06:40 PM |
| Make a function that ONLY counts the players. |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 06:56 PM |
| I fail to understand how that would help. I HAVE to check to make sure that object is in their Player object or else I'm going to end up trying to spawn players that are not ready to play. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 11 Oct 2014 06:57 PM |
| So instead of checking forever, only check when you are about to spawn people in |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 07:23 PM |
| Forget it. No matter how much I try to explain what I'm planning on doing, nobody understands me. I don't blame you. I blame myself. I'm too stupid to speak clearly. Screw it. I'm done. I give up. Nothing is worth this much trouble. |
|
|
| Report Abuse |
|
|