Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

[Tutorial] Script that ages User

15 years ago
IF %MONTHS > 11 THEN
BEGIN
%MONTHSHELP := %MONTHS / 12
%MONTHS := %MONTHS - (12 * %MONTHSHELP)
%AGE := %AGE + %MONTHSHELP
%MONTHSHELP := 0
END

It's for age. Essentially, MONTHSHELP is a hidden variable, MONTHS is the amount of months over the current age the character is, and age is the number of years old the character is.

Sooo with this script, let's say I add 14 months to a guy who'se 19 years and 1 month old.

The script will do this:

Months is greater than 12 (It's 15)
BEGIN
Monthshelp is 1 (15/12, 19/12, 23/12 will all equal 1)
Months = 3 (15-12)
Age = 20 (19 + 1 (1 is monthshelp))
Monthshelp is cleared to 0
End

Final Result:

Character is 20 years and 3 months old and it's capable of handling any number of months I throw at it in a single link from 1 to 500000000 lol!

[Tutorial] Script that ages User

15 years ago
I wrote a separate one that makes it so that it only displays the age if it's different than it was on the page before.

[Tutorial] Script that ages User

15 years ago

That's pretty useful.

[Tutorial] Script that ages User

15 years ago
It works without the IF %MONTHS > 11 too.