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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Getting memberCount..

Previous Thread :: Next Thread 
LordMerc is online. LordMerc
Joined: 04 Dec 2012
Total Posts: 101
08 Jul 2014 08:57 PM
It might seem wierd, but I amm having trouble getting a group member count..

Its a surfaceGUI brick like this: Group members:
Counting...

I am trying to change Counting... text to the group member number. Any help??
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
08 Jul 2014 09:09 PM
local getG=function(gid)
local count=0
for _,player in ipairs(game:service'Players':GetPlayers())do
if plr:IsInGroup(tonumber(gid))then
count=count+1
end
end
return tostring(count)
end

script.Parent.Text='Group members: '..getG
Report Abuse
LordMerc is online. LordMerc
Joined: 04 Dec 2012
Total Posts: 101
08 Jul 2014 09:14 PM
(Sorry for being a noob in scripting, just really starting a little) Say my group id is 1005066 Where would I put that?
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
08 Jul 2014 10:28 PM
local getG=function(gid)
local count=0
for _,player in ipairs(game:service'Players':GetPlayers())do
if plr:IsInGroup(tonumber(gid))then
count=count+1
end
end
return tostring(count)
end

script.Parent.Text='Group members: '..getG(1005066)
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
08 Jul 2014 10:42 PM
local getG=function(gid)
local count=0
for _,plr in ipairs(game:service'Players':GetPlayers())do
if plr:IsInGroup(tonumber(gid))then
count=count+1
end
end
return tostring(count)
end

script.Parent.Text='Group members: '..getG(1005066)
Report Abuse
LordMerc is online. LordMerc
Joined: 04 Dec 2012
Total Posts: 101
09 Jul 2014 12:41 AM
If a API is needed, can someone help?
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
09 Jul 2014 12:51 AM
Do you want to amount of players in-game in your group, or just the grand total?
Report Abuse
LordMerc is online. LordMerc
Joined: 04 Dec 2012
Total Posts: 101
09 Jul 2014 11:03 AM
Not in-game but just in the group total.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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