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: Line 5: Attempt to index a number value

Previous Thread :: Next Thread 
Vexture is not online. 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 is not online. Vexture
Joined: 27 Jan 2011
Total Posts: 630
31 Mar 2015 07:10 PM
Bump.
Report Abuse
eLunate is not online. 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 is not online. Vexture
Joined: 27 Jan 2011
Total Posts: 630
31 Mar 2015 07:13 PM
Well, terribly sorry for that, m'lady.
Report Abuse
jewelycat is not online. 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 is not online. Vexture
Joined: 27 Jan 2011
Total Posts: 630
31 Mar 2015 07:17 PM
Thanks!
Report Abuse
Vexture is not online. Vexture
Joined: 27 Jan 2011
Total Posts: 630
31 Mar 2015 07:20 PM
..Still getting the same error. qq
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