|
| 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
|
  |
| 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 |
|
|
|
| 13 Oct 2010 04:26 PM |
script.Parent.Humanoid.Died:connect(function() SoundNameHereAndDefineIt:Play() end) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2010 04:29 PM |
fail = script.Parent.Sound script.Parent.Humanoid.Died:connect(function() Fail:Play() end()
Like this? |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2010 04:30 PM |
no...
fail = script.Parent.Sound script.Parent.Humanoid.Died:connect(function() fail:Play() end) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2010 04:30 PM |
| Depends on where the script is in. |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2010 04:31 PM |
| Also when this palys the people around will be able to hear? |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 13 Oct 2010 04:51 PM |
| I've done it just like it was here and it'snot working... |
|
|
| Report Abuse |
|
|