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: Please Help?

Previous Thread :: Next Thread 
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
28 Jul 2016 09:44 PM
parent = script.Parent
music = game--temporary variable
math.randomseed(tick())
musicSeed = math.random(1, 5)

if musicSeed == 1 then
music = parent.Music1
elseif musicSeed == 2 then
music = parent.Music2
elseif musicSeed == 3 then
music = parent.Music3
elseif musicSeed == 4 then
music = parent.Music4
elseif musicSeed == 5 then
music = parent.Music5
end

--[===[

Error:Music2 not valid member of Frame

The "Frame" is the parent of the script and the Music's. Why doesn't it think that the Music's are valid members of the Frame? I tried referencing them locally and directly from the game. Please help?

]===]


#code -- Online
Report Abuse
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
28 Jul 2016 09:52 PM
Help please?


#code -- Online
Report Abuse
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
28 Jul 2016 10:00 PM
Ah, nvm. had to waitforchild


#code -- Online
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
28 Jul 2016 10:48 PM
Do something like "parent.Music..musicSeed"

and you can get rid of all those nasty elseifs
You can concatenate numbers iirc without using tostring


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