Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
|
| 09 Apr 2014 11:14 AM |
I'm trying to make it so when you step on a brick it makes sound1 stop and sound2 play. This is all i got so far
while true do script.sound1:Stop() wait(10) script.sound2:Play()
How would I make this working? |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 11:17 AM |
| use OnTouch... and id decrease the wait a liitle |
|
|
| Report Abuse |
|
|
Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
|
| 09 Apr 2014 11:21 AM |
workspace.PATH.TO.BRICK.Touched:connect(function() script.sound1.SoundId = "whatever" end)
while true do script.sound1:Stop() wait(3) script.sound1:Play()
end
Would this work? |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 11:25 AM |
function onTouched(hit) -- do stuff script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 11:25 AM |
^^^^^^ put that script in a brick |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 11:27 AM |
game.Workspace.PATH.TO.BRICK.Touched:connect(function() --Guesssing you know the drill here. script.sound1.SoundId = "whatever" --Guesssing you know the drill here also. end)
while true do script.sound1:Stop() wait(3) script.sound1:Play() wait(3) --Change 3 to whatever if needed. end
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 11:28 AM |
ahaaaaaaaaah k, watchout or ima shoot you |
|
|
| Report Abuse |
|
|
Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
|
| 09 Apr 2014 11:33 AM |
@spongocardo
I did this with your script
game.Workspace.PATH.TO.BRICK.Touched:connect(function() --Guesssing you know the drill here. script.sound1.SoundId = "http://www.roblox.com/asset/?id=130987585" --Guesssing you know the drill here also. end)
while true do script.sound1:Stop() wait(3) script.sound1:Play() wait(3) --Change 3 to whatever if needed. end
Not sure if I did it right because it's not working |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 11:36 AM |
PATH.TO.BRICK needs to be changed to the path of the brick you want. If you want it to play the sound as well when you touch it, use this:
game.Workspace.PATH.TO.BRICK.Touched:connect(function() --PATH.TO.BRICK needs to change to your path to the brick. script.sound1.SoundId = "http://www.roblox.com/asset/?id=130987585" --Guesssing you know the drill here also.
while true do script.sound1:Stop() wait(3) script.sound1:Play() wait(3) --Change 3 to whatever if needed. end end)
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|
Frostehz
|
  |
| Joined: 03 Apr 2014 |
| Total Posts: 628 |
|
| |
|
Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
|
| 09 Apr 2014 11:58 AM |
game.Workspace.Brick.Touched:connect(function() --Guesssing you know the drill here. script.sound1.SoundId = "http://www.roblox.com/asset/?id=146824166" --Guesssing you know the drill here also. end)
while true do script.sound1:Stop() wait(3) sound2:Play() wait(3) end
so this would work if i have a part named brick just in workspace and sound2 isn't in a script?
Just to make sure the soundid part you're supposed to put the sound1 id right? |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 09 Apr 2014 12:12 PM |
That'd not actually audibly play your sound. You're playing it then stopping it immediately. There's also no need for a while true do loop.
local db = false local time = tonumber(whatever) game.Workspace.path.to.part.Touched:connect(function() if db == false then db = true script.sound1:Stop() wait(time) script.sound2:Play() else return end db = false end)
--Shira |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 12:18 PM |
| you're stopping it and waiting 3 seconds and playing it and then instantly stopping it again |
|
|
| Report Abuse |
|
|