Okay, so here's my code:
privategatesphere = createColSphere ( 1394, -2438, 14, 12 )
privateGate = createObject(16773, 1393.1313476563, -2438.46875, 16.553903579712, 16, 0, 270)
function openprivateGate()
if (getPlayerFromName("crwblyth" or "XxHEWESxX")) then
moveObject(privateGate, 7000, 1390.3840332031, -2438.361328125, 20.691507339478)
end
end
function closeprivateGate()
if (getPlayerFromName("crwblyth" or "XxHEWESxX")) then
moveObject(privateGate, 7000, 1393.1313476563, -2438.46875, 16.553903579712)
end
end
addEventHandler ( "onColShapeHit", privategatesphere, openprivateGate )
addEventHandler ( "onColShapeLeave", privategatesphere, closeprivateGate )
This opens a gate when the colshape is hit and closes it when it is left
But what happens when one person enters as the other leaves?
There is a clash here, any ideas how I could code it so it would work properly?
Regards,
Cozza