Lua
local theGate = createObject(ID,x,y,z,rx,ry,rz9)
setElementData(theGate,"status",1)
function openGate( player , cmd )
local x,y,z = getElementPosition( player )
local x1,y1,z1 = getElementPosition( theGate )
if getDistanceBetweenPoints3D(x,y,z,x1,y1,z1) < 5 then
if getElementData( theGate,"status") == 1 then
moveObject(2000,x,y,z,rx,ry,rz)
setElementData( theGate,"status",2)
outputChatBox("Tor wird geöffnet!",source,0,0,255)
elseif getElementData( theGate,"status") == 2 then
moveObject(2000,x,y,z,rx,ry)
setElementData( theGate,"status",1)
outputChatBox("Tor wird geschlossen!",source,0,0,255)
end
end
end
addCommandHandler("move",openGate)
--------------
-No Copyright-
---Free Use---
--------------
Alles anzeigen