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 » Scripting Helpers
Home Search
 

Re: Tables...

Previous Thread :: Next Thread 
xvgigakid is not online. 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 is not online. 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
XhappysmileX is not online. XhappysmileX
Joined: 22 Feb 2009
Total Posts: 124
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 is not online. 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 is not online. 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 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
07 Jul 2011 03:38 PM
wow. Latepost?
Report Abuse
xvgigakid is not online. 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
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