-
Notifications
You must be signed in to change notification settings - Fork 0
/
AttachAnimation.lsl
63 lines (55 loc) · 1.36 KB
/
AttachAnimation.lsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
@name: AttachAnimation
@description:
@author: Zai Dium
@version: 1.10
@updated: "2023-06-18 19:38:24"
@revision: 6
@localfile: ?defaultpath\Torpedo\[email protected]
@source: https://github.com/zadium/AttachAnimation.lsl
@license: MIT
@ref
https://community.secondlife.com/forums/topic/477699-laser-that-rezzes-in-front-of-you-on-command-how-to/
llRezAtRoot( "MySuperLaserGun", llGetPos() + <2.0,0.0,1.5>*llGetRot(), ZERO_VECTOR, llGetRot(), 0);
*/
//* settings
string animation = "Launcher";
default
{
state_entry()
{
if (llGetAttached())
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}
attach(key id)
{
if (id != NULL_KEY)
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}
else
{
if (animation != "")
{
llStopAnimation(animation);
}
}
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
if (llGetAttached())
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
llStartAnimation(animation);
}
}
}