|
| 01 Jan 2014 01:44 PM |
| I want to make a script that replaces the traditional death sound effect with another sound. Can someone help me? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 06 Jan 2014 01:23 AM |
function deadsound(soundid,player) local s = Instance.new("Sound",player.PlayerGui) s.SoundId = "http://www.roblox.com/asset/?id="..soundid s:Play() end
game:GetService("Players").PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(chr) local hums = char:GetChildren() for a= 1,#hums do if hums[a].ClassName == "Humanoid" then
hums[a].Died:connect(function() deadsound(132319294,plr) --change soundid here end)
end end end) end) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 01:25 AM |
--I made a typo on lline 14 char is supposed to be chr I fixed it in this post
function deadsound(soundid,player) local s = Instance.new("Sound",player.PlayerGui) s.SoundId = "http://www.roblox.com/asset/?id="..soundid s:Play() end
game:GetService("Players").PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(chr) local hums = chr:GetChildren() for a= 1,#hums do if hums[a].ClassName == "Humanoid" then
hums[a].Died:connect(function() deadsound(132319294,plr) end)
end end end) end)
deadsound(132319294,game.Players.Player1) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 01:26 AM |
Ugh keep making small mistakes remove the last line deadsound(132319294,game.Players.Player1) sorry Dx |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2014 09:19 PM |
| I don't understand... Could you put instructons in the script like "Replace this with _____" |
|
|
| Report Abuse |
|
|