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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 01:35 AM |
/WVyCpUq5
Its a table dictionary
|
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
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
|
  |
| Joined: 26 Dec 2015 |
| Total Posts: 1140 |
|
|
| 12 Feb 2017 02:56 AM |
Ah thanks it works perfectly now!
|
|
|
| Report Abuse |
|
|