Try this out:
Code:
--OnEvent (Panel 1):
if event == "UNIT_ENTERED_VEHICLE" then
if (CanExitVehicle()==1) then
self:Hide()
end
elseif event == "UNIT_EXITED_VEHICLE" then
if (CanExitVehicle()==nil) then
self:Show()
end
end
--OnEvent (Panel 2):
if event == "UNIT_ENTERED_VEHICLE" then
if (CanExitVehicle()==1) then
self:Show()
end
elseif event == "UNIT_EXITED_VEHICLE" then
if (CanExitVehicle()==nil) then
self:Hide()
end
end
To my understanding it's exactly what you said would be wrong, that event listens for anyone to enter/leave a vehicle so it'd be going crazy on and off without you.
Lemme know if this works!