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: Choosing random ID from a table for image

Previous Thread :: Next Thread 
TimeTicks is not online. 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 is not online. 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 is not online. 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 is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
26 Apr 2015 10:24 PM
rbxassetid://



pls


I script -~ chimmihc
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
26 Apr 2015 10:50 PM
I do what I want.
Report Abuse
vacha is not online. 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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
26 Apr 2015 11:37 PM
@vacha, Just preference.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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
gutterball6 is not online. gutterball6
Joined: 18 Jan 2016
Total Posts: 2
18 May 2016 03:15 PM
ids
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
18 May 2016 03:17 PM
why did you bump a dead thread
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