07-10-2013, 03:45 PM
on walk - play sound
Quote:/*
Rekson Walk Sound Script
If you need any help with this script or are unsure about anything send me a message on Scaler Rexen and I will gladly assist you.
--Setup
All you have to do is put the sound you want to play inside the same object you put this script into and it will play when you walk! it's as easy as that. You do not need to change anything below.
*/
key owner;
string sound;
default
{
on_rez(integer p)
{
llResetScript();
}
state_entry()
{
owner=llGetOwner();
sound=llGetInventoryName(INVENTORY_SOUND,0);
llSetMemoryLimit(llGetUsedMemory()+512);
if(sound!="")
{
llSetTimerEvent(.25);
}
else
{
llSetTimerEvent(0);
llOwnerSay("Please put a sound in and reset the script.");
}
}
timer()
{
if(llGetAgentInfo(owner)&AGENT_WALKING)
{
llLoopSound(sound,1);
}
else
{
llStopSound();
}
}
}