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 » Scripters
Home Search
 

Re: Why isn't this random

Previous Thread :: Next Thread 
Prenup is not online. Prenup
Joined: 26 Dec 2015
Total Posts: 1140
12 Feb 2017 01:30 AM
PokemonStats = { ["Rattata"] = {math.random(1,4), math.random(10,13), ################################## 5, math.random(5,7), math.random(5,8)} } fetchPokemon = "Rattata" ############# "..PokemonStats[fetchPokemon][1].." HP: "..PokemonStats[fetchPokemon][2].." Attack: "..PokemonStats[fetchPokemon][3].." Defense: "..PokemonStats[fetchPokemon][4].." Special Atk: "..PokemonStats[fetchPokemon][5].." Special Def: "..PokemonStats[fetchPokemon][6].." Speed: "..PokemonStats[fetchPokemon][7]) Output everytime: Level: 4 HP: 13 Attack: 5 Defense: # Special Atk: 5 Special Def: 5 Speed: 8 sorry if this is confusing
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
12 Feb 2017 01:31 AM
paste bin it


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to ,see me code in action? Follow me on twitch: twitch.tv/austinrblx
Report Abuse
Prenup is not online. Prenup
Joined: 26 Dec 2015
Total Posts: 1140
12 Feb 2017 01:31 AM
Since ROBLOX's filter messed it up


PokemonStats = {
["Rattata"] = {math.random(1,4), math.random(10,13), math.random(5,7),math.random(5,7), 5, math.random(5,7), math.random(5,8),55}
}



Every time I print the table values its the same number even thought I put "math.random"


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
12 Feb 2017 01:31 AM
because you set it to # variable. Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to ,see me code in action? Follow me on twitch: twitch.tv/austinrblx
Report Abuse
Prenup is not online. Prenup
Joined: 26 Dec 2015
Total Posts: 1140
12 Feb 2017 01:35 AM
/WVyCpUq5

Its a table dictionary


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
12 Feb 2017 01:53 AM
Yeah, but you're defining it there. So the keys in the table aren't going to change every time you reference it. They'll probably change every time you run the game though.


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to ,see me code in action? Follow me on twitch: twitch.tv/austinrblx
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
12 Feb 2017 02:09 AM
pastebin
.
com/wAqvugP3


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
12 Feb 2017 02:09 AM
That's how you should be doing it. Dictionaries can solve everything.


Report Abuse
Prenup is not online. Prenup
Joined: 26 Dec 2015
Total Posts: 1140
12 Feb 2017 02:56 AM
Ah thanks it works perfectly now!


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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