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
 

IntValue not changing?

Previous Thread :: Next Thread 
llcoolj03 is not online. 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
GlacierGames is not online. GlacierGames
Joined: 22 Oct 2011
Total Posts: 1549
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
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
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 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
14 Aug 2015 12:07 PM
^ Lol.
Report Abuse
llcoolj03 is not online. 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 is not online. 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
GlacierGames is not online. GlacierGames
Joined: 22 Oct 2011
Total Posts: 1549
14 Aug 2015 12:12 PM
Players is a tracker value not a number.
What are you trying to compare here?
Report Abuse
llcoolj03 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
14 Aug 2015 12:29 PM
bump
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
14 Aug 2015 12:33 PM
bump1337
Report Abuse
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
14 Aug 2015 12:41 PM
Did you even try what I said?
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