Technique -
Scripts
|
Écrit par ssm2017
|
Jeudi, 27 Décembre 2007 14:23 |
La porte cloulissante la plus simple possible.
// ssm2017 Binder : ssm_simple_timed_sliding_door
// @copyright Copyright (C) 2007 ssm2017 Binder (S.Massiaux). All rights reserved.
// @license GNU/GPL, http://www.gnu.org/licenses/gpl-2.0.html
// ssm_simple_timed_sliding_door is free software. This version may have been modified pursuant to the
// GNU General Public License, and as distributed it includes or is derivative
// of works licensed under the GNU General Public License
// or other free or open source software licenses.
vector closed;
float size = 1;
float duration = 3.;
integer opened = FALSE;
default
{
state_entry()
{
closed = llGetLocalPos();
}
touch_start(integer num_detected)
{
if ( opened )
{
llSetPos(closed);
opened = FALSE;
}
else
{
llSetPos(closed + <0.,size,0.>);
opened = TRUE;
llSetTimerEvent(duration);
}
}
timer()
{
llSetPos(closed);
llResetScript();
}
}
|