Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get an audio to play when a player is 50 health or below?

really not much to say down here..

2 answers

✓ Accepted answer
while true do
wait()
local humanoid=script.Parent--In a separate script, have it clone into players

if humanoid then
local plr=humanoid.Parent:GetPlayerFromCharacter()
if humanoid.Health<=50 then
if plr.PlayerGui.Sound.IsPlaying=false then
plr.PlayerGui.Sound:Play()--If you put the sound in PlayerGui, only the player hears it(So I have been told)
end
elseif humanoid.Health>=51 then
if plr.PlayerGui.Sound.IsPlaying=true then
plr.PlayerGui.Sound:Stop()
 

end
end
end
end

Sorry if this doesn't work. Since you didn't show what you tried, you have to clone the script

if Humanoid.Health <= 50 then --I'll Assume u have already defined Humanoid
Sound:Play() --I'll just Assume u have already defined Sound

2 comments

0

thats just the thing itself, if u dont know wat other stuff to type, tell me

0

I don't..

This discussion is preserved as it was. New answers, comments, and votes are closed.