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: is this line of code correct?

Previous Thread :: Next Thread 
alvin1104 is not online. 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
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
25 Jul 2014 02:49 PM
winnerMsg.Text = "Game Over! The winner is... ".. unpack(plrs).."! Congratulations!"
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
25 Jul 2014 02:49 PM
tostring(unpack(plrs))
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
25 Jul 2014 02:49 PM
.. table.concat(plrs, ', ') ..
Report Abuse
HuntHello is not online. HuntHello
Joined: 19 Jan 2011
Total Posts: 577
25 Jul 2014 02:50 PM
3 different answers lol
Report Abuse
HuntHello is not online. 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
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
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
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
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 is not online. 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 is not online. 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
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