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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 04 Dec 2012 |
| Total Posts: 101 |
|
|
| 09 Jul 2014 12:41 AM |
| If a API is needed, can someone help? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 04 Dec 2012 |
| Total Posts: 101 |
|
|
| 09 Jul 2014 11:03 AM |
| Not in-game but just in the group total. |
|
|
| Report Abuse |
|
|