llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 14 Aug 2015 11:39 AM |
local NumPlayers = game.Players.NumPlayers local gamePlayers = script.Parent.gamePlayers ... gamePlayers.Value = NumPlayers
The IntValue is not changing to the Number of Players. However, I have another script that changes the same IntValue but it changes it in that script! |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 11:41 AM |
The variable NumPlayers is getting the number of players at the current time. You should back up the Variable to Game.Players. then later do Players.NumPlayers
local Players = game.Players local gamePlayers = script.Parent.gamePlayers
gamePlayers.Value = Players.NumPlayers |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 11:42 AM |
| I believe you have to put a "." in between "game" and "Players." Instead of gamePlayers, do "game.Players". It should work |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 14 Aug 2015 12:10 PM |
Now I'm getting an error on line 13.
line 13: if Players.NumPlayers >= Players then
Output: 18:09:34.045 - Players.Player.PlayerGui.Main.HUD.main:13: attempt to compare userdata with number |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 14 Aug 2015 12:12 PM |
first off, i would rename your Players variable as it could conflict with your Players variable that refers to the Players service.
*if Players.NumPlayers >= yourPlayers.Value
because you were trying to compare NumPlayers with the intvalue object itself, not its value |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 12:12 PM |
Players is a tracker value not a number. What are you trying to compare here? |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 14 Aug 2015 12:19 PM |
| I change that however nothing is happening still :l |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 14 Aug 2015 12:20 PM |
you're trying to compare your player's int value itself to NumPlayers. simply put:
*if Players.NumPlayers >= yourRequiredNumOfPlayersIntValue.Value |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 14 Aug 2015 12:23 PM |
| Sorry I must of misworded something. My IntValue is a value inside of the script's parent and it is supposed to be the number of players in the current round. |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 14 Aug 2015 12:25 PM |
| I've tried everything I can think of but nothing is working! |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
|
| 14 Aug 2015 12:41 PM |
| Did you even try what I said? |
|
|
| Report Abuse |
|
|