|
| 10 May 2015 03:45 PM |
Keeping post short and understandable. Please do not post if you're going to give me an unintelligent or non-serious answer.
I'm trying to make a script where when you touch a brick it stops the current sound playing and plays the one in the script.
Ex. Player 1 steps on Brick X which stops playing music from Brick Y and plays music inside Brick X's script.
It should be easy.
function Brick(hit)
game.Workspace.MusicBlock.sound:Play()
end
script.Parent.Touched:connect(Brick) |
|
|
| Report Abuse |
|
|
| |
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 14 May 2015 03:18 PM |
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then -- if a humanoid exists, then local NewSound = Instance.new("Sound") NewSound.SoundId = "ID" Sound:Stop NewSound:Play() end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 May 2015 06:17 PM |
| You connected a hit function with touched, you have to use either or |
|
|
| Report Abuse |
|
|