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: Real Lua is fun! And help!

Previous Thread :: Next Thread 
MultiSettings is not online. MultiSettings
Joined: 23 Aug 2013
Total Posts: 2924
28 Jul 2014 08:15 PM
how do I use table.sort properly?

my example real lua code:
local stupid_people = {"you"};local smart_people = {"me"};for i,v in pairs(stupid_people) do print("stupid people: "..stupid_people[math.random(1,#stupid_people)]);end;for i,v in pairs(smart_people) do print("cool & smart people: "..smart_people[math.random(1,#smart_people)]);end;print(2 + 2);if 2 + 2 == 5 then print("2+2=5");end;if 2 + 2 == 4 then print("2+2=4");end;table.insert(smart_people, "swiggity swag");print(smart_people[2]);if smart_people[2] == "swiggity swag" then print(" O_O ");end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
28 Jul 2014 08:24 PM
What's with the random code? Whatever:
http://www.lua.org/pil/19.3.html
Report Abuse
FadingGalaxy is not online. FadingGalaxy
Joined: 24 Jul 2014
Total Posts: 42
28 Jul 2014 08:53 PM
wow, here it is simplified and not all messy:

local stupid_people = {"you"}
local smart_people = {"me"}
for i,v in pairs(stupid_people) do
print("stupid people: "..stupid_people[math.random(1,#stupid_people)])
end
for i,v in pairs(smart_people) do
print("cool & smart people: "..smart_people[math.random(1,#smart_people)])
end
print(2 + 2)
if 2 + 2 == 5 then
print("2+2=5")
end
if 2 + 2 == 4 then
print("2+2=4")
end
table.insert(smart_people, "swiggity swag")
print(smart_people[2])
if smart_people[2] == "swiggity swag" then
print(" O_O ")
end
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
28 Jul 2014 08:56 PM
@cntkillme: He is a troll, so you can ignore him.
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