xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 07 Jul 2011 03:35 PM |
Well I am a decent scripter... And honestly I am a fail at tables. I almost never use tables and therefor I am a fail at it. So this is my question to the S&H forum.
Lets say I create a table
table = {123,53,647,134}
Now we have this player who has entered. Now to check what group he is in...
---------------------------------------- table = {123,53,647,134}
function team() for i = 1,#table do if Player:IsInGroup(table[i]) then print("Blah") end end ----------------------------------------
How would I find wich one of the group's IDs the Player is in? |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 07 Jul 2011 03:37 PM |
table = {123,53,647,134}
function team() for i = 1,#table do if Player:IsInGroup(table[i]) then return table[i] end end end
print("Player is in group: "..team()) |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2011 03:37 PM |
local tableGroups = {1,2,3,4}
function FindFirstPlayerGroup(Player) for i,v in pairs(tableGroup) do if Player:IsInGroup(v) then return v end end end |
|
|
| Report Abuse |
|
|
Shobobo99
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 5754 |
|
|
| 07 Jul 2011 03:37 PM |
table = {123,53,647,134}
function team(player) for i = 1,#table do if player:IsInGroup(table[i]) then print("Blah") return table[i] end end
If you call the function for a certain player then you can get what group they are in if any. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 07 Jul 2011 03:38 PM |
| Why do I feel like such an idiot right nao? |
|
|
| Report Abuse |
|
|
Shobobo99
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 5754 |
|
| |
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 07 Jul 2011 03:43 PM |
Not that late. When I opened the Tables thread it had only ONE reply from spectrum. As soon as I posted
'Why do I feel like an idiot'
2 others posted so It isn't that late if you look at it from a diffrent angle :/ |
|
|
| Report Abuse |
|
|