|
| 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
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 3939 |
|
| |
|
|
| 12 Oct 2013 03:27 PM |
| What do you mean? How to I add the sound in? |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 03:29 PM |
i think he meant
if Player.Health <= 0 then sound:Play() end |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 12 Oct 2013 04:54 PM |
| I was talking about a script builder script. |
|
|
| Report Abuse |
|
|
| |
|