Bean666 Posted July 6, 2016 Posted July 6, 2016 how do i use getTeamFromName using tables thanks in advance local teams = { "Military", "FIB", "SWAT" } local theTeam = getTeamFromName("??") Aftermath
Walid Posted July 6, 2016 Posted July 6, 2016 check this: --Example 1: local teams = { ["Team1"] = teamName1; ["Team2"] = teamName2; } -- then you can use this to get the team from name local theTeam = getTeamFromName(teams["Team1"]) -- Example 2 local teams = { team1 = teamName1; team2 = teamName2; } -- and you can use this to get the team from name local theTeam = getTeamFromName(teams.team1) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Captain Cody Posted July 6, 2016 Posted July 6, 2016 Or you can use this teama = teams[1] --- Switch out 1 with the number you want as long as its in range in the table. But after looking at what you want, other guys solution would work better I believe.
Bean666 Posted July 6, 2016 Author Posted July 6, 2016 actually what i want is not like this what i wanted is all the stuff on the table not 1 2 3 stuff or maybe i just missed something , but yeah ill try something / learn on my own Aftermath
Captain Cody Posted July 6, 2016 Posted July 6, 2016 Teamsb = {} Teams = { "Military", "FIB", "SWAT" } for i,v in pairs (Teams) do Teamsb[v] = getTeamFromName[v] end This what you looking for?
Bean666 Posted July 6, 2016 Author Posted July 6, 2016 aye aye thanks. what does the Teamsb = {} do? Aftermath
Captain Cody Posted July 6, 2016 Posted July 6, 2016 That sets up the table. Table = {} -- Creates an empty table Table[1] = "Test" -- Assigns a value to the table function test () local tablea = Table[2] -- Turns value #2 into a local table local tablea[1] = "test" -- Assigns a value to the table local tableb = tablea[1] -- Deeper table. --- And so on
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now