TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 26 Apr 2015 10:13 PM |
Im brain dead. I forgot how to choose a random id from a table.. ._.
ids = { id1, id2, id3, }
local base = 'http://www.roblox.com/asset/?id=' for i = 1,#ids do pic.Image = base..tostring(math.random(1,ids[i])) end
How do I choose a random value from the table? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 26 Apr 2015 10:20 PM |
i fixed it
ranPic = math.random(1, #ids) picChosen = ids[ranPic] local base = 'http://www.roblox.com/asset/?id=' for i = 1,#ids do pic.Image = base..tostring(picChosen) end |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 26 Apr 2015 10:21 PM |
local template = 'http://www.roblox.com/asset/?id=' local ids = {}
for i = 1,#ids do pic.Image = base..ids[math.random(1,#ids)] wait() end |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 26 Apr 2015 10:24 PM |
rbxassetid://
pls
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 26 Apr 2015 11:35 PM |
| @chim, Is there any difference between using "rbxassetid://" vs the full link? Or is it just preferred because it's short? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 27 Apr 2015 04:30 AM |
| @Ghoul You changed base to template but still concatenated base. If you're gonna change variables don't break the script lol |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Apr 2015 04:41 AM |
<-- I swear he broke the script not me!!
I would never!! lol. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 May 2016 03:17 PM |
| why did you bump a dead thread |
|
|
| Report Abuse |
|
|