Author Topic: About the Playsound event  (Read 802 times)

is there anyway to make it play a sound once

Yeah.
Input event> Self > Playsound SOUNDFILE

Bam, you played it once.

no i have a on player touch event
i want it to play the sound once, every time you step on the platform
except while your on the platform it repeats the sound i only want it to play once each time you step on it

Code: [Select]
[0000] OnPlayerTouch> Self > Playsound [SOUNDFILE]
[0001] OnPlayerTouch> Self > CancelEvents

Code: [Select]
[0000] OnPlayerTouch> Self > Playsound [SOUNDFILE]
[0001] OnPlayerTouch> Self > CancelEvents
didn't work


Code: [Select]
[0000] OnPlayerTouch> Self > Playsound [SOUNDFILE]
[0001] OnPlayerTouch> Self > setRayCasting "off"
[0002] (1000) OnPlayerTouch> Self> setRayCasting "on"

See if that works

The problem is that if you let a person only play 1 sound, if he stays on there, the sound wont play till everyone gets off it.
Unless you use the variable events like so:

  • OnPlayerTouch > Self > ifVariable Player touchsound Equals 0
  • [0] VariableTrue > self > playsound Sounddatablock
  • VariableTrue > Player > setVariable touchsound 1
  • [400] VariableFalse > Player > setVariable touchsound 0
  • VariableFalse > Self > cancelEvents


If that don't work tell me.

The problem is that if you let a person only play 1 sound, if he stays on there, the sound wont play till everyone gets off it.
Unless you use the variable events like so:

  • OnPlayerTouch > Self > ifVariable Player touchsound Equals 0
  • [0] VariableTrue > self > playsound Sounddatablock
  • VariableTrue > Player > setVariable touchsound 1
  • [400] VariableFalse > Player > setVariable touchsound 0
  • VariableFalse > Self > cancelEvents


If that don't work tell me.

worked, thanks