local marker = -- The marker element you want to prevent the player from hitting
function onVehicleCollision(hitElement, force, bodyPart, collisionX, collisionY, collisionZ, normalX, normalY, normalZ, material1, material2)
if getElementType(hitElement) == "vehicle" then
-- Check if the player is in a vehicle
local player = getVehicleOccupant(hitElement)
if player and getElementType(player) == "player" then
-- Player is in a vehicle and colliding with the marker
if isElementWithinMarker(hitElement, marker) then
-- Do something here (e.g., cancel the collision, display a message, etc.)
cancelEvent()
end
end
end
end
addEventHandler("onVehicleCollision", root, onVehicleCollision)