10-22-2006 17:16
im working on this open script i got and im not that great at scripting everytime i try to make it do what i want it to do i well i break it lol so heres the script


( integer campmoney = 0; // Initial amount to grant someone upon the VERY first sit after first rez. (Think, Special bonus)
integer campadd = 2; // Payout amount
integer camptime = 600; // Payout time in seconds (Script USES this)
string camptimeM = "10"; // Payout time in minutes (Attract SAYS this)
string reciever; // key of Sitter
default {
state_entry() {
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT ); //Ask my owner for permission to give money and assume it suceeds
llSetText("sit here for free money,\nL$"+(string)campadd+" every "+camptimeM+" minutes",<0,1,0>,1); // Set the hovertext to attract mode
llSitTarget(<0.4, 0, 0.6>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work
// Note that if both the vector and the rotation are zero,
// the SitTarget is removed instead of set and the following will not work:
}

changed(integer change) { // something changed
if (change & CHANGED_LINK) { // and it was a link change
if (llAvatarOnSitTarget() != NULL_KEY) { // if Avatar key isn't empty, somebody is sitting on me
reciever = llAvatarOnSitTarget(); // store sitting avatar's key
llSetText("Money: L$"+(string)campmoney,<0,1,0>,1); // Setting hovertext to current amount earned
llSetTimerEvent(camptime); // amount of time between payments in seconds
//llSay(0, "Get off!";);
//llUnSit(llAvatarOnSitTarget()); // unsit him
}
else{ // if the avatar has gotten up
llGiveMoney(reciever,campmoney); // give the avatar the amount of money he has earned.
reciever=""; // forget who the receiver was
campmoney=0; // reset earning count to 0
llSetText("sit here for free money,\nL$"+(string)campadd+" every "+camptimeM+" minutes",<0,1,0>,1); // change the hovertext back to attract mode
llSetTimerEvent(0); // Nobody is sitting on me, so no need to call timer(). Disable timer.
}
}
}
timer()
{
campmoney = campmoney+campadd; // current amount + xL$ per camptime
llSetText("Money: L$"+(string)campmoney,<0,1,0>,1); // update hovertext with currently earned amount
if (llAvatarOnSitTarget() != NULL_KEY) {} // If there's someone sitting on me, Do Nothing, ELSE

else { // Noone's sitting on me, reset the vars
reciever=""; // forget who the receiver was
campmoney=0; // reset earning count to 0
llSetText("sit here for free money,\nL$" + (string)campadd + " every "+camptimeM+" minutes",<0,1,0>,1); // change hovertext back to attract mode
llSetTimerEvent(0); // Nobody is sitting on me, so no need to call myself anymore. Disable timer.
}
}
}
PHP)


and what im looking to do is add some comands to it so i can set things without haven to mod the script, i want to add on and off chat comands by owner and a diolog comand would rock for setting payout of 1-20 lindens then when set price another diolog comes down so you can set the time of 5 mins to 60 mins, if anyone can help me i will be willing to pay you ingame. and remember the setting can only work for the owner, oh and also with a chat comand or diolog comand be able to change the color of the text :D