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: Sound played when dead

Previous Thread :: Next Thread 
BitetheDust is not online. BitetheDust
Joined: 07 Mar 2009
Total Posts: 49
13 Oct 2010 04:25 PM
Isn't there is a script that plays a sound when a player dies?
I can't make it or find it, I just have a guess that it starts with somethiling like this
function:onPlayerDie(or death)
Sound.play

Help me with this oe please
Report Abuse
oysi93 is not online. oysi93
Joined: 27 Apr 2008
Total Posts: 12469
13 Oct 2010 04:26 PM
Humanoid.Died:connect(function()
Sound:Play()
end)

Of course, you have to make 'Humanoid' and 'Sound',
but if you know how to script it shouldn't be a problem. =)
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:26 PM
script.Parent.Humanoid.Died:connect(function()
SoundNameHereAndDefineIt:Play()
end)
Report Abuse
BitetheDust is not online. BitetheDust
Joined: 07 Mar 2009
Total Posts: 49
13 Oct 2010 04:29 PM
fail = script.Parent.Sound
script.Parent.Humanoid.Died:connect(function()
Fail:Play()
end()


Like this?
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:30 PM
no...



fail = script.Parent.Sound
script.Parent.Humanoid.Died:connect(function()
fail:Play()
end)
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
13 Oct 2010 04:30 PM
Depends on where the script is in.
Report Abuse
BitetheDust is not online. BitetheDust
Joined: 07 Mar 2009
Total Posts: 49
13 Oct 2010 04:31 PM
Also when this palys the people around will be able to hear?
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:34 PM
Yes
Report Abuse
BitetheDust is not online. BitetheDust
Joined: 07 Mar 2009
Total Posts: 49
13 Oct 2010 04:38 PM
Also I'm noticing: "script.Parent.Humanoid" the sound will only play when a humanoid on the Workspace dies or when a player dies? If it's for the workspace one, how do I make this script to copy itself to a player?
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
13 Oct 2010 04:40 PM
If you want this sound to play when another player dies, make a script that clones the death script into a player when they respawn. Example

function onRespawned(player)
--Stuff
end

game.Workspace.ChildAdded:connect(onRespawned)
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
13 Oct 2010 04:42 PM
BEST WAY:

Script - the script I'm about to show you
_ Thing - the script swordy gave you
_ _ sound - the sound

Script:

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
script.Thing:clone().Parent = char
end)
end)

Thing:

repeat wait() until script.Parent.className == "Model"
script.Parent.Humanoid.Died:connect(function()
script.sound:Play()
end)

:D
Report Abuse
BitetheDust is not online. BitetheDust
Joined: 07 Mar 2009
Total Posts: 49
13 Oct 2010 04:46 PM
Like this:
Thing:

sound = SoundID
repeat
wait()
until script.Parent.className == "Model"
script.Parent.Humanoid.Died:connect(function()
script.sound:Play()
end)

Script:

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
script.Thing:clone().Parent = char
end)
end)

I have to put Thing script into the Script Script and test
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
13 Oct 2010 04:47 PM
no, just do it my way, and rename the stuff. It's easier that way >.> less confusing >.>
Report Abuse
BitetheDust is not online. BitetheDust
Joined: 07 Mar 2009
Total Posts: 49
13 Oct 2010 04:51 PM
I've done it just like it was here and it'snot working...
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