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 » Game Design
Home Search
 

Re: Scripting Error

Previous Thread :: Next Thread 
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
09 Jan 2015 06:53 PM
This script is supposed to play a certain sound when a player dies. Here's the line of code:

local sDied = newSound("http://www.roblox.com/asset/?id"OnDeath"")

"OnDeath" being the ID of the death sound. This line causes the script to return an error. How do I fix this?

~Rock is dead. Long live paper and scissors!~
Report Abuse
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
10 Jan 2015 10:19 AM
BUMP

~Rock is dead. Long live paper and scissors!~
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
10 Jan 2015 10:20 AM
local sDied = newSound("http://www.roblox.com/asset/?id=" .. OnDeath)

logic is logical
Report Abuse
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
10 Jan 2015 10:30 AM
@Devious

Thanks. However, I am encountering a new error. I moved the problematic line of the script to the line that I have already presented:

local sDied = newSound("http://www.roblox.com/asset/?id"..DeathSound(math.random(1,3))"")

"DeathSound" being a table of death sounds.



~Rock is dead. Long live paper and scissors!~
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
10 Jan 2015 11:43 AM
local sDied = newSound("http://www.roblox.com/asset/?id="..DeathSound[math.random(1,#DeathSound)])

logic is logical
Report Abuse
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
10 Jan 2015 12:19 PM
@Devious

Works like a charm now. Thanks for your help.

~Rock is dead. Long live paper and scissors!~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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