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: Table handling

Previous Thread :: Next Thread 
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
01 Sep 2012 07:26 PM
I know a random character would be:
mobs[math.random(1,#mobs)]

But how would I select a random strike inside the characters?



mobs = {
["Chuck Norris"] = {
["Falcon Punch"] = {
damage = 50
stamina = 100
critical = 100
}
["Roundhouse kick"] = {
damage = 100
stamina = 0
critical = 100
}
}
["Arnold"] = {
["Handshake"] = {
damage = 60
stamina = 50
critical = 100
}
}
}
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
01 Sep 2012 07:36 PM
local mob = mobs[math.random(1, #mobs)]
local attack = mob[math.random(1, #mob)]
local dmg = attack[math.random(1, #attack)
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
01 Sep 2012 07:39 PM
.___.

I mean, as you can see, the strikes are inside the mobs table.
Inside characters. And their damages and others are inside the strikes.

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