if (llSameGroup(llDetectedKey(0)))
{
CODE
integer price;
resetscript()
{
llResetScript();
}
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
{
state setprice;
}
}
on_rez(integer pop)
{
resetscript();
}
}
state setprice
{
state_entry()
{
llInstantMessage(llGetOwner(),"set the description of this prim to the price then touch it");
}
touch(integer pop)
{
if (llSameGroup(llDetectedKey(0)))
{
price = (integer)llGetObjectDesc();
llInstantMessage(llGetOwner(),"price set to "+(string)llGetObjectDesc());
state now_excepting_cash;
{
}}}}
state now_excepting_cash
{
state_entry()
{
llSay(0,"open");
price = (integer)llGetObjectDesc();
}
money(key id, integer amount)
{
// how do I add a only for sale if in the same group as this is set to?
// if (llSameGroup(llDetectedKey(0)))
// {
llSay(0,"same group");
price = (integer)llGetObjectDesc();
if(amount >= price)
{
if(amount - price > 0)
{
llGiveMoney(id, (amount - price));
llInstantMessage(id, "heres your change"+(string)(amount - price));
}
llGiveInventory(id,"thing thats inside it");
}
else
{
llGiveMoney(id, amount);
llInstantMessage(id, "Price is L$" + (string)price);
}
}
}