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
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 28 Jul 2016 09:52 PM |
Help please?
#code -- Online |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 28 Jul 2016 10:00 PM |
Ah, nvm. had to waitforchild
#code -- Online |
|
|
| Report Abuse |
|
|
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 |
|
|