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 » Scripting Helpers
Home Search
 

Re: On death sound script

Previous Thread :: Next Thread 
Jaden11212 is not online. Jaden11212
Joined: 16 Jan 2011
Total Posts: 13
12 Oct 2013 02:47 PM
I need help with a script. I need a script that will make a sound on death. for expample, If I die, a sound will play.
Report Abuse
Excellus is not online. Excellus
Joined: 17 Jun 2013
Total Posts: 3939
12 Oct 2013 02:48 PM
humanoid.die.play.sound()
Report Abuse
Jaden11212 is not online. Jaden11212
Joined: 16 Jan 2011
Total Posts: 13
12 Oct 2013 03:27 PM
What do you mean? How to I add the sound in?
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
12 Oct 2013 03:29 PM
i think he meant

if Player.Health <= 0 then
sound:Play()
end
Report Abuse
Thewsomeguy is not online. Thewsomeguy
Joined: 06 Aug 2011
Total Posts: 520
12 Oct 2013 03:32 PM
Add your sound to StarterGui, so it will play locally (tell me if you want it to play on the server)
Also, make this a LocalScript.

local LocalPlayer = game.Players.LocalPlayer;
local Character = LocalPlayer.Character;
if(not Character) then
return;
end -- stop running if they don't have a character (maybe they fell off the map?)
local Humanoid = Character:findFirstChild("Humanoid");
if(not Humanoid) then
return;
end

repeat wait() until LocalPlayer.StarterGui and LocalPlayer.StarterGui.OnDeathSound --I think it's StarterGui...

Humanoid.Died:connect(function()
LocalPlayer.StarterGui.OnDeathSound:Play()
end)
Report Abuse
Jaden11212 is not online. Jaden11212
Joined: 16 Jan 2011
Total Posts: 13
12 Oct 2013 04:54 PM
I was talking about a script builder script.
Report Abuse
Jaden11212 is not online. Jaden11212
Joined: 16 Jan 2011
Total Posts: 13
12 Oct 2013 05:55 PM
Bump...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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