Attached is a project showing one way to repeat a timed sound effect.
The 'Trigger Loop' event which is currently set to 'When Examined' can be changed to activate 'If Approached' or such.
Here's the breakdown
-------------------------------------------
Event#1 (Event Trigger=[trigger can be anything you want it to be]) [This Event starts up the loop in Event#2]
Control Active Leaf (Target='Event#2' - Move to Leaf01)
--------------------------------------------
Event#2 (Event Trigger=Always On) [This Event actually plays the timed/looped the sound effect]
Leaf00
Change Counter Value (Set 'Counter00-Times Played' to 0)
Leaf01
Play Sound Effect
Alter Counter Value (Raise 'Counter00-Times Played ' by 1)
Begin Timer00
Control Active Leaf (This Event Forward by 1)
Leaf02
IF ('Times Played Counter' =4)
Control Active Leaf (This Event to Leaf0)[This ends the loop after 4 plays]
OTHERWISE
Set Timer Value In Counter (Acquire Value From 'Timer0' & Set its value in 'Counter01-TimePassed')
IF ('Counter01-TimePassed' =3)[This waits 3 seconds before replaying the sound]
Control Active Leaf (This Event Move to Leaf01)[This restarts the loop]
END IF
END IF
-----------------------------------------------
The 'Trigger Loop' event which is currently set to 'When Examined' can be changed to activate 'If Approached' or such.
Here's the breakdown
-------------------------------------------
Event#1 (Event Trigger=[trigger can be anything you want it to be]) [This Event starts up the loop in Event#2]
Control Active Leaf (Target='Event#2' - Move to Leaf01)
--------------------------------------------
Event#2 (Event Trigger=Always On) [This Event actually plays the timed/looped the sound effect]
Leaf00
Change Counter Value (Set 'Counter00-Times Played' to 0)
Leaf01
Play Sound Effect
Alter Counter Value (Raise 'Counter00-Times Played ' by 1)
Begin Timer00
Control Active Leaf (This Event Forward by 1)
Leaf02
IF ('Times Played Counter' =4)
Control Active Leaf (This Event to Leaf0)[This ends the loop after 4 plays]
OTHERWISE
Set Timer Value In Counter (Acquire Value From 'Timer0' & Set its value in 'Counter01-TimePassed')
IF ('Counter01-TimePassed' =3)[This waits 3 seconds before replaying the sound]
Control Active Leaf (This Event Move to Leaf01)[This restarts the loop]
END IF
END IF
-----------------------------------------------