I've been working on a donation script. There is one part I'm stuck on - setting the goal. The piece of code below shows the part that is giving me trouble.
CODE
integer goal;
integer num;
default
{
on_rez(integer start)
{
llResetScript();
}
state_entry()
{
ownerkey = llGetOwner();
owner_name = llKey2Name(ownerkey);
num = FALSE;
llSleep(0.2);
update();
llSay(0, "Online!");
llSleep(0.5);
llListen(0, "",ownerkey,"");
}
listen(integer channel, string name, key id, string message)
{
if(num == FALSE)
{
if(llToLower(message)=="setgoal")
{
llSay(0, "Please say the number for the goal to be set to.");
num = TRUE;
}
}
else
{
(string)goal == (string)goal + message;
num = FALSE;
llSay(0, "Goal set to "+(string)goal+".");
}
}
}
Thanks in advance.