03-20-2007 08:14
Hello,

I'm not really a scripter but i'm trying, but i ran into a problem i can't find a solution for, so i'm trying my luck here, so maybe there is somebody out there that could put me back on track.

I'm trying to make a teleport that people need to pay, before they can use, so i went went looking a bit everywhere in different script truying to put one togheter, below is what i can with, the problem how every is simple it' don't work!

So if somebody could help me on my way i could be very happy

my code -------------------

vector target=<43,113,21>; // Enter the target coordinates here!!!
integer TPprice=5;

no_access() {
llSetSitText("Sit Here";);
llSitTarget(<0,0,0>, ZERO_ROTATION);
llSetColor(<1,0,0>, ALL_SIDES);
}

access() {
llSetColor(<0,1,0>, ALL_SIDES);
llSetSitText("Teleport";);
llSitTarget(target, ZERO_ROTATION);
}


default
{
state_entry()
{
llSetText("Pay to Teleport",<255,255,255>,5);
}
changed(integer change)
{
llUnSit(llAvatarOnSitTarget());
}
on_rez(integer start_param)
{
llResetScript();
}
money(key giver, integer amount)
{
if (amount < TPprice)
{
llSay(0, "Teleport costs L$" + (string) TPprice);
llSay(0, "You paid $L"+(string)amount+", which is not enough!";);
llGiveMoney(giver, amount);
}
// no_access();
else
{
llSay(0, "Thank you for your purchase!";);
access();
if (amount > TPprice)
{
llGiveMoney(giver, amount - TPprice);
}

}
}
}