Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.nolimitscoaster.*;
- import nlvm.math3d.*;
- public class soundTrigger extends Script implements TrackTriggerListener {
- private static final String sSoundFile = "Music.ogg";
- StaticSound sSound;
- public soundTrigger() {
- sSound = StaticSound.loadFromFile(sSoundFile, StaticSound.E_ENVMODE_LOCAL);
- if(sSound == null) {
- System.err.println("Sound file not found");
- return;
- }
- sSound.setPosition(new Vector3f(-14.0f, 35.0f, 50.0f));
- sSound.setGain(10.0f);
- }
- public void onTrainEntering(TrackTrigger trigger, Train train) {
- sSound.play();
- }
- public void onTrainLeaving(TrackTrigger trigger, Train train) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement