|
| 30 Dec 2013 08:37 PM |
I'm just using a 3 line script to play a sound that is looped, and the script removes itself. It works in edit mode when I run it, but when I save and go online mode, they don't emit sound. I've tried with the script being in the sound, then outside it.
Inside the sound
script.Parent:play() wait(1) script:remove()
In part emitting sound
script.Parent.Sound:play() wait(1) script:remove()
P.S - Any way that if someone enters an area, the sound is played? would it function and be built like non sword killing land, used in fencing? |
|
|
| Report Abuse |
|
|
Pricm
|
  |
| Joined: 08 Feb 2013 |
| Total Posts: 5391 |
|
|
| 30 Dec 2013 08:39 PM |
what is script:remove()?
it is script.Parent.Sound:Remove()
and
script.Parent:Remove() |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:39 PM |
s = script.Parent.Sound repeat wait() s:Stop() wait() s:Play() until s.IsPlaying wait(1) script:remove()
~God Bless~ Twitter - @Batpower54 |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:40 PM |
| @Pric, I use script:Remove() to remove the script after the sound plays (as its already set to looped in properties) |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 30 Dec 2013 08:41 PM |
| Online mode loads differently so the player doesn't hear the sound playing since it started playing before they entered |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:42 PM |
I had this problem, and I sort of cheated to get around it, there are better ways to do it, but here is my way. I checked the sound to change it so that it was on loop and it played when the sound was removed, this works, but unfortunately you can't change the sound id or pause it.
You can also do it with a button, that way works and you don't have to delete the sound. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:48 PM |
@Bat
The script still doesn't play the sound when in online |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:49 PM |
@Rosie
So check play on remove and make it loopable? |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:49 PM |
| The sound is playing, just not playing in the right place. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 08:53 PM |
The sound I have emitting from a block, the block is anchored into place This is how it is in explorer (soundemit is the part containing script & sound
Workspace.Model.soundemit
both the script's and the sound's parent is soundemit |
|
|
| Report Abuse |
|
|