Lua
local Schranke1 = createObject(968, 226.30000305176, -8.3999996185303, 2.2000000476837, 0, 268, 270) -- Zu Dillimore hin, Rotation auf: 0, 0, 270
addEventHandler("onColShapeHit", Col1,
function(hitElement)
if(getElementType(hitElement) == "vehicle") then
if(Tor1auf == false) then
Tor1auf = true
moveObject(Schranke1, 1000, 226.30000305176, -8.3999996185303, 2.2000000476837, 0, 92, 0, "InOutQuad")
setTimer(setElementRotation, 1000, 1, Schranke1, 0, 0, 270)
end
end
end)
addEventHandler("onColShapeLeave", Col1,
function(hitElement)
if(getElementType(hitElement) == "vehicle") then
if(Tor1auf == true) then
if(#getElementsWithinColShape(Col1) > 2) then return end
Tor1auf = false
moveObject(Schranke1, 1000, 226.30000305176, -8.3999996185303, 2.2000000476837, 0, -92, 0, "InOutQuad")
setTimer(setElementRotation, 1000, 1, Schranke1, 0, 268, 270)
end
end
end)
Alles anzeigen
Was ist daran falsch