Vexture
|
  |
| Joined: 27 Jan 2011 |
| Total Posts: 630 |
|
|
| 31 Mar 2015 07:09 PM |
local storemusic = script.Parent:WaitForChild("storemusic") while true do wait() local allmusic = storemusic:GetChildren() choosemusic = allmusic[math.random(1,#allmusic):Play()] function ondeath(plyr) local players = game.Players:GetPlayers() humanoid = players.plyr.Character:WaitForChild("Humanoid") end for _, players in pairs(humanoid) do if humanoid.Health <= 0 then choosemusic = allmusic[math.random(1,#allmusic):Play()] end end end
--I am attempting to make a random music selector for my game. Please explain the error and how I might fix it. |
|
|
| Report Abuse |
|
|
Vexture
|
  |
| Joined: 27 Jan 2011 |
| Total Posts: 630 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 31 Mar 2015 07:11 PM |
You were the only view on your own post, with the sole purpose to bump.
I don't even want to help this child |
|
|
| Report Abuse |
|
|
Vexture
|
  |
| Joined: 27 Jan 2011 |
| Total Posts: 630 |
|
|
| 31 Mar 2015 07:13 PM |
| Well, terribly sorry for that, m'lady. |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 31 Mar 2015 07:15 PM |
choosemusic = allmusic[math.random(1,#allmusic):Play()]
you're attempting to call :Play() on a number, put it outside the bracket |
|
|
| Report Abuse |
|
|
Vexture
|
  |
| Joined: 27 Jan 2011 |
| Total Posts: 630 |
|
| |
|
Vexture
|
  |
| Joined: 27 Jan 2011 |
| Total Posts: 630 |
|
|
| 31 Mar 2015 07:20 PM |
| ..Still getting the same error. qq |
|
|
| Report Abuse |
|
|