dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 30 Sep 2012 03:32 PM |
say i have this table: people={"asd","lol"}
how would I make an if statement that checked if a.Name was one of the items in the people table? so it would end up looking like this people thing (however you do it) if a.Name=people then |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 03:34 PM |
for _,v in pairs(people) do if Player.Name == v then print("hai c:") end end
you will have to define Player yourself |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 30 Sep 2012 03:36 PM |
@black
More efficient ;)
for i,v in pairs(people) do print(Player.Name == v and "hai C:") end |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 03:37 PM |
This is more efficient if you receive any lag.
for i=1, #people do if player.Name==people[i] then print("Hello World!") end end |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 03:38 PM |
| if arguments can be integrated into a print''? |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 03:38 PM |
| @Drak, no miz's is way better. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 30 Sep 2012 03:40 PM |
| I was told pairs() was inefficient. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|