so any advice of help would be cool, heres what i have, the first bit about the note card is what i added, but as far as i know i messed it up, though it compiles ok so i dunno, im new at this hehe
string gNotecard = "Prize Chair Configuration";
integer gLine = 0;
integer timeToGive1 = 300; // Time required for campers to camp (in seconds)
string prize1 = ""; // The name of the prize (must be in the camp chair's inventory)
integer ctlChannel = 12; // Control channel, default is 12321, MUST CHANGE THIS!!!
// Type /12 kick in chat to kick the camper off
// Remember to setup difference channels or all camp chairs nearby will kick their campers
// Internal Veriables
integer sitTime = 0;
key sitter;
string sitterName;
default
{
state_entry()
{
if (prize1 == ""
{
prize1 = llGetInventoryName(INVENTORY_OBJECT,0);
}
llSitTarget(<0.3,0,-0.4>,<1,0,0,0>
;llSetText("Ready for camping\nSit here for "+(string) (timeToGive1 / 60)+"minute(s) to get "+prize1+" for free!",<1,1,1>,1);
sitTime = 0;
sitter = NULL_KEY;
sitterName = "No one";
}
changed(integer change)
{
if (change & CHANGED_LINK) {
key target = llAvatarOnSitTarget();
if (target) {
sitter = target;
sitterName = llKey2Name(target);
state sitting;
}
}
}
}
state sitting
{
state_entry()
{
llSetTimerEvent(1.0);
llListen(ctlChannel,"",NULL_KEY,""
;}
listen(integer channel, string name, key id, string msg) {
if (channel == ctlChannel) {
if (msg == "kick"
{llUnSit(sitter);
}
}
}
timer()
{
llSetText(" Chair in use\nOccupied by "+sitterName + "\nwill get "+prize1+" after " + (string) (timeToGive1 - sitTime) + " second(s)",<1,1,1>,1);
if (sitTime++ > timeToGive1) {
llGiveInventory(sitter,prize1);
llUnSit(sitter);
llSay(0,sitterName + ", thank you for camping, enjoy your prize!"
;state default;
}
}
changed(integer change)
{
if (change & CHANGED_LINK) {
if (llAvatarOnSitTarget() == NULL_KEY)
state default;
}
}
}
