Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For this script to work you must set up the following parameters:
- name: disco
- type: sequencer
- value: a sequencer that has the keywords ‘fever’ and ‘hips’ corresponding to animations
- name: discomusic
- type: sound
- value: browse to the ogg file you want to play
- function animPlayDelayed() {
- animPlay(context.data);
- }
- function foundPlayer() {
- var playerEnt = context.data.ent;
- //if (!get(playerEnt)) {
- animAddSequencer({ ent: playerEnt, sequencer: 'disco'});
- set(playerEnt, true);
- //}
- var animation = 'fever';
- if (randomInt(0,1) === 0) {
- animation = 'hips';
- }
- timerCreate({
- name: 'animPlayDelayed' + playerEnt,
- script: 'animPlayDelayed',
- delay: 0.75,
- data: {
- ent: playerEnt,
- keyword: animation
- }
- });
- }
- function findPlayers() {
- getEnts({
- radius: 3.0,
- callback: 'foundPlayer',
- channel: 'physics'
- });
- }
- function init() {
- timerCreate({
- name: 'findPlayers',
- period: 1.0
- });
- soundStart({sound: 'discoMusic'});
- }
- call('init');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement