alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 25 Jul 2014 02:47 PM |
winnerMsg.Text = "Game Over! The winner is... ".. unpack(plrs)"! Congratulations!" look at the .. unpack(plrs) part |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 02:49 PM |
| winnerMsg.Text = "Game Over! The winner is... ".. unpack(plrs).."! Congratulations!" |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jul 2014 02:49 PM |
| .. table.concat(plrs, ', ') .. |
|
|
| Report Abuse |
|
|
HuntHello
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
| |
|
HuntHello
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
|
| 25 Jul 2014 02:53 PM |
| notunknown has the simplest and easiest to use code tho |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 02:56 PM |
assuming plrs is an actual table, then do :
if(#plrs>=2) then winnerMsg.Text = "Game over. The winners are : ".. table.concat(plrs, ",").. "! Congratulations!"; else winnerMsg.Text = "Game over. The winner is : "..plrs[1].."! Congratulations!" end
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 02:56 PM |
quick fix
if(#plrs>=2) then winnerMsg.Text = "Game over. The winners are : ".. table.concat(plrs, ", ").. "! Congratulations!"; else winnerMsg.Text = "Game over. The winner is : "..plrs[1].."! Congratulations!" end |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 25 Jul 2014 02:59 PM |
He also has the only working one
local tab = {"a", "b"} print("hello " .. unpack(tab))
Output; hello a
local tab = {"a", "b"} print("hello " .. table.concat(tab, ", "))
Output; hello a, b |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Jul 2014 03:08 PM |
If you want to be a noob:
local tab = {"a", "b"} print("hello", unpack(tab)); |
|
|
| Report Abuse |
|
|