|
| 14 May 2016 08:42 PM |
I wanted so when someone has 20 health, it will play music. Here script::
local player = game.Players.LocalPlayer
player.Character.Humanoid.Health.Changed:connect(function() if player.Character.Humanoid.Health <= 20 then game.Workspace.Sound:Play(167602797) --change? end
And tell me whether to put it into local or normal script.
if local script, tell me where to put that local script |
|
|
| Report Abuse |
|
|
|
| 14 May 2016 08:58 PM |
well in workspace you need to put the id 167602797 into the SoundId field, and then call it
workspace.Sound:Play()
-- 4 8 15 16 23 42 |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 May 2016 09:38 PM |
Put the ID in the 'SoundID' property.
Then use the inbuilt function :Play() on the sound object.
R$2,200 lol im poor |
|
|
| Report Abuse |
|
|
|
| 14 May 2016 09:40 PM |
| there is no param in play. |
|
|
| Report Abuse |
|
|
|
| 15 May 2016 08:04 AM |
local player = game.Players.LocalPlayer repeat wait() until player.Character.Humanoid
player.Character.Humanoid.Changed:connect(function() -- Health has no .Changed property so -- just put Humanoid.Changed if player.Character.Humanoid.Health <= 20 then game.Workspace.Sound:Play() -- Create a sound in the workspace and put the id of the song --in the soundid field end
end)
--Put this in a local script |
|
|
| Report Abuse |
|
|
|
| 15 May 2016 12:22 PM |
Two questions:
1. Do I have to Put The Music ID between the parenthesis in::: Play()?
2. Where do I put this local script. Workspace? Players?
|
|
|
| Report Abuse |
|
|
|
| 15 May 2016 12:23 PM |
| Nevermind the first Question. |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 May 2016 01:05 PM |
Better put the localscript in the starterpack or startergui. Js. |
|
|
| Report Abuse |
|
|