Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

help: prim touch count?

Sorazoe Dodonpa
Registered User
Join date: 21 Nov 2006
Posts: 12
11-08-2008 00:52
I've been trying to figure out how to make a script that will count the number of times its been clicked, and then report how many times its been clicked.

so far I havent any luck in figuring out how. So does anyone have a clue on how to do this?
BertusDebacle Bade
Registered User
Join date: 2 Aug 2007
Posts: 4
11-08-2008 02:31
From: Sorazoe Dodonpa
I've been trying to figure out how to make a script that will count the number of times its been clicked, and then report how many times its been clicked.

so far I havent any luck in figuring out how. So does anyone have a clue on how to do this?



integer Counter;

default
{
state_entry()
{
Counter = 0;
}

touch_start(integer total_number)
{
Counter++ ;
llSay(0, (string)Counter + " times touched.";);
}
}
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
11-08-2008 02:32
Well, define a global variable:

integer count=0;

In the touch event:

touch_start(integer number)
{
++count;
llSetText("Number of clicks " + (string) count,<1,1,1>,1);
}
Sorazoe Dodonpa
Registered User
Join date: 21 Nov 2006
Posts: 12
11-08-2008 02:41
thank you both, both of them work perfectly ^^