Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sound when player dies script?

Asked by 10 years ago

I've tried putting in everything I know- nothing would work... I'm trying to make a script like when a player dies, play a sound, or well go down through the list of ID/sounds and not make it play the same thing over and over, but once at the end of list, repeat... or maybe even randomly play the sound...

0
Your code? Perci1 4988 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

The script below may or may not work (if it doesnt, any scripter pros pls correct it as i just started two weeks ago, also answer my question about the gui!!!!!) and if it does work vote please! Also here is a link just for good info to eat wiki.roblox.com/index.php?title=Sounds

local sound = Instance.new("Sound")
sound.SoundId = "PUT YOUR AUDIO ASSET ID HERE"
sound.Parent = game.Workspace
p = game.Workspace.Players.LocalPlayer

function playsound()
if p.humanoid.Health = 0
then sound:Play()
end

Make sure to check syntax errors. If it doesnt work but still widened your knowledge of this topic please upvote! Also where it says put the asset id is where you put the asset id if you dont know how to do that tell me. Also put this in the workspace but if u want it in an object insert it in one and add the name of the object at the end of this script already in there ~~~~~~~~~~~~~~~~~ sound.Parent = game.Workspace ~~~~~~~~~~~~~~~~~

Ad

Answer this question