Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need Script! Unknown/Unset Integer

Gabriel Speculaas
Registered User
Join date: 2 Oct 2005
Posts: 1
01-19-2006 19:55
I am currently trying to build a script, but I am not sure how to even start it.

It needs to have a string that will be set to a value (example: "interger" Cat = 50)

Then I need the script to be listening for an integer to be stated, this integer is unknown and unset by the script.

When the script hears this unset integer it needs to subtract it from the string (example: I say 7 and the script takes "interger" Cat = 50 and subtracts 7 and now "integer" Cat = 43)

This is really alot to ask for I understand but if I could get this it would take a world of stress off my sholders. Thank you so much!
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
01-20-2006 06:53
something along the lines of this example?
CODE
integer Cat;

default
{
state_entry()
{
Cat = 50;
llListen(0, "", llGetOwner(), "");
}

listen(integer channel, string name, key id, string message)
{
Cat -= (integer)message;
llOwnerSay("Value of Cat is " + (string)Cat);
}
}