Please let there be anyone who can help me.
I have found this script in the Forum that is actually working perfectly. But, I would like to add some more to this script. I have been trying this now for a couple of days without success (which is normal I guess since I have no experiences in scripting at all).
I have this script that creates a sound when my Avatar is Walking. What I would like to add is the choice to Turn ON/OFF the sound by a command in open chat and something that makes the sound not stop abruptly when my Avatar stops walking but fades out more slowly instead.
the script I found:
key owner_key;
integer owner_walking;
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
llSetTimerEvent(0.25);
owner_key = llGetOwner();
}
changed(integer change)
{
if(change & CHANGED_OWNER)
{
owner_key = llGetOwner();
}
}
on_rez(integer param)
{
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
}
run_time_permissions(integer perm)
{
llTakeControls(CONTROL_UP, FALSE, TRUE);
}
timer()
{
integer walking = (llGetAgentInfo(owner_key) & AGENT_WALKING) != 0;
if(walking)
{
if(!owner_walking)
{
llLoopSound("jingle-bells", 1.0);
}
}
else
{
if(owner_walking)
{
llStopSound();
}
}
owner_walking = walking;
}
}
I would be very thankfull for any help.
; // listen for chat commands from owner only
so that is the good part. The bad part is that I am maybe to stuppid but the sound is not fading away slowly yet (Do I need to do some settings in the script?) and my other question is: where do I have set the chat-commands in the script to turn the sound on/off?