Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Simple Walk
- // Copyright (c) 2009, the owner of avatar Catherine Pfeffer
- // Distributed under GPL license version 2
- // See details at http://www.gnu.org/licenses/gpl-2.0.html
- // Change to changed event to make script lighter
- string VERSION = "2.0";
- string animation;
- key owner;
- default
- {
- state_entry()
- {
- integer perms = llGetPermissions();
- animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
- owner = llGetOwner();
- llSetAlpha(0.0, ALL_SIDES);
- llOwnerSay("version " + VERSION + ".");
- if (perms & PERMISSION_TRIGGER_ANIMATION)
- state enabled;
- llRequestPermissions(llGetOwner(),
- PERMISSION_TRIGGER_ANIMATION);
- }
- run_time_permissions(integer perms)
- {
- if (perms & PERMISSION_TRIGGER_ANIMATION)
- {
- state enabled;
- }
- }
- }
- state enabled
- {
- state_entry()
- {
- llOwnerSay("ready.");
- }
- attach(key _av)
- {
- llResetScript();
- }
- changed(integer _ch)
- {
- if(( _ch & CHANGED_ANIMATION) == CHANGED_ANIMATION)
- {
- string anim = llGetAnimation(owner);
- // llSay(0, "CH: " + anim);
- if (llGetAnimation(llGetOwner()) != "Walking")
- {
- llStopAnimation(animation);
- }
- else
- {
- llStartAnimation(animation);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment