Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripter Wanted - Easy job

Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
09-27-2008 21:43
Scripter wanted to take the following script and make it work =x

One object, two prices. It looks like it should work to me, but it don't. I've tried asking under Scripting Tips before but no one's ever been willing. Lemme know your charge first. I'm also still fussing with it.

---

//Title: Multiple Person Vendor (Originally One Person Vendor)
//Date: 01-28-2004 04:38 PM
//Version: 1.0.0
//Scripter: Ama Omega
//Modified: Malina Chuwen 9-27-08
//
integer price = 10; // adjust accordingly
integer second = 20;
string item = "Object";
string itemb = "Object2";

default
{
state_entry()
{
llSetPayPrice(PAY_HIDE, [price, second, PAY_HIDE, PAY_HIDE]);
}
}

state run
{
money(key id, integer amount)
{
if (amount = price);
llGiveInventory(id,item);

if (amount = second);
llGiveInventory(id,itemb);
}
}

--------
--------------------------
--------

With this in the first part, it kinda works.. It shows both prices, but gives both items with either one paid:

default
{
state_entry()
{
llRequestPermissions( llGetOwner(), PERMISSION_DEBIT );
llSetPayPrice(PAY_HIDE, [price, second, PAY_HIDE, PAY_HIDE]);
}
run_time_permissions(integer perms)
{
if (perms & PERMISSION_DEBIT)
state run;
}
}
_____________________
-- Please do not PM =) Average wait time for me to notice can be up to a week in some cases, lol. IM/Notecard in game. I do have PMs on but prefer in game.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-27-2008 21:56
Change this bit...

CODE

if (amount = price);
llGiveInventory(id,item);

if (amount = second);
llGiveInventory(id,itemb);


..to be..

CODE

if (amount == price)
llGiveInventory(id,item);

if (amount == second)
llGiveInventory(id,itemb);

Not the lack of a ; at the end of the 'if' statements and the use of the compare operator, ==, instead of the assignment operation, =.
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
09-27-2008 23:04
You rock!! =D Thank you SO much!
_____________________
-- Please do not PM =) Average wait time for me to notice can be up to a week in some cases, lol. IM/Notecard in game. I do have PMs on but prefer in game.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-27-2008 23:50
:)

Happy to help.