Ok i have won half way.
I want to open and close a door, but my script give me an error.
this is my script it works for up but not for down.
function door_up_down_init(e)
door_pos = 0
y = 0
door_per = 0
up_per = 0
end
function door_up_down_main(e)
--823
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 90 then
door_per = 1
end
if door_per == 1 then
y = GetEntityPositionY ( e )
door_pos = y
if door_pos <= 910 then
CollisionOff(e)
MoveUp(e,5.5)
CollisionOn(e)
--Prompt(door_pos)
end
if door_pos >= 909 then
up_per = 1
end
end
if door_pos > 824 and up_per == 1 and PlayerDist > 120 then
CollisionOff(e)
MoveDown(e,5.5)
CollisionOn(e)
end
end
This is the error i get when the door must go down.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11