I'm not really a expert, far from, but i do understand some scripting, so i tried to pick bits and pieces from all kind of script in the attempt to get a pay 2 teleport script going, but it don't work,
The teleport works all the time if you pay or not and that is not what it should do, so can anybody help me in the right direction of what i'm doing wrong
All help welcome
Thank you
--- My code so far ----
vector target=<43,113,21>; // Enter the target coordinates here!!!
integer TPprice=5;
no_access() {
llSetSitText("Sit Here"
;llSitTarget(<0,0,0>, ZERO_ROTATION);
}
access() {
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);
}
}
}
}