Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Pose Ball Synced Pose balls  

Synced Pose balls

Two Or more people sit on two or more pose balls. The pose balls play a series of animation in sync

Category: Pose Ball
By : Ferd Frederix
Created: 2016-05-02 Edited: 2016-05-02
Worlds: Second Life

the Zip file

Download all files for Synced Pose balls
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // To use this, just put several dances in a prim and add this script.
2 // Shift-copy the prim. Anyone who touches it will dance in sync with anyone else who touches it.
3
4
5 float RATE = 10.0; // rate to play animations
6
7 string lastDance; // the last dance played on the slave script
8 string animation ; // the currwent animation name we must play
9 integer index; // the num,ber of that animation found in inventory
10 key avatarK; // the key of tjhe seated avatar
11 integer channel = -12134; // some random number
12 integer granted = FALSE;
13
14 default
15 {
17 {
19 llListen(channel,"","","");
20 }
21
23 {
25 }
26
27
28 changed (integer detected)
29 {
30 if(detected & CHANGED_LINK)
31 {
32 avatarK = llAvatarOnSitTarget();
33 if(avatarK != NULL_KEY)
34 {
35 index = 0;
37 } else {
38 granted = FALSE;
40 }
41 }
42
43 }
44
45
47 {
49 {
50 granted = TRUE;
51 animation = llGetInventoryName(INVENTORY_ANIMATION, index); // first animation
52 llSay(channel,animation); // tell another poseball to let them dance.
53 llStartAnimation(animation);
54 llSetTimerEvent(RATE);
55 }
56 }
57
58 timer()
59 {
60 integer newindex = index; // We must stop old animation
61 newindex++; // and play new one
62
63 // test to see if we are past the end
65 newindex = 0;
66
67 llSay(channel,llGetInventoryName(INVENTORY_ANIMATION, newindex)); // tell another poseball to let them dance.
70
71 index = newindex; // get ready for the next animation
72 }
73
74 listen(integer channel, string name, key id, string message)
75 {
76 llSetTimerEvent(0); // last one to send a message wins control
77
78 if(granted)
79 {
80 llStartAnimation(message);
81 if(llStringLength(lastDance))
82 llStopAnimation(lastDance);
83 lastDance = message;
84 }
85 }
86 }

Back to the Best Free Tools in Second Life and OpenSim.