hi:
trap
islmovile= yes
always active=yes
ai system ==default lua
trap door
always active=yes
islmovile-yes
ai system:
script for trap door
-- Created by: Terry Ingalls aka: Tingalls 7/26/2014
-- Opens door automatically and closes it when player is away from door
local open = {}
function doorauto_init(e)
open[e] = 0
end
function doorauto_main(e)
if GetPlayerDistance(e) < 150 then
if open[e] == 0 then
-- door is closed
StartTimer(e);
if g_Entity[e]['animating'] == 0 then
SetAnimation(0);
SetAnimationSpeed(e,100);
PlayAnimation(e);
open[e] = 1
g_Entity[e]['animating'] = 1;
PlaySound(e,0);
end
else
if open[e] == 1 then
-- door collision off after 1 second
if GetTimer(e)>20 then
CollisionOff(e);
end
end
end
elseif GetPlayerDistance(e) > 150 then
--door is open
if open[e] == 1 then
if g_Entity[e]['animating'] == 0 then
SetAnimation(1);
PlayAnimation(e);
PlaySound(e,1);
g_Entity[e]['animating'] = 1;
open[e] = 0;
CollisionOn(e);
end
end
end
end
PROPERTIES of trap door
name.....trap
static mode...yes
occluder....yes
occlodee...yes
specular...100
ai system......default lua
spawn at start...yes
strength....0
speed.....100
anim speed....100
islmobile...yes
lod modifier...0
phisics on...yes
always active...yes
phisics weigth....100
phisics friction....100
explodable....no
explode damage...100
name.....TRAP DOOR
occluder.....yes
occludee....yes
specular.....100
ai system....main..doorauto lua
span at start....yes
strength....0
speed......100
anim speed....100
islmobile.....yes
lod modifier.......0
phisics on.....yes
always active....yes
phisics weigth......100
phisics friction...100
explodable .....no
explode dammage......100
this is all that i can get from the properties.....and a copy of the script for the trap door
nazco