I have a vehicle (heli) and I want to respawn it every 30 minutes and if it has a player inside then don’t remove the entity. I can not seem to find a way to check if it contain a player or not, this is what I have been using so far and it works fine. I just need a method to check if it has a player inside:
function heli() heli = ents.Create("sent_helicopter_nonadmin") heli:SetPos( Vector( -6523.794922, -2548.979004, 99.388809 ) ) heli:Spawn() timer.Create( "RemoveHeli", 59, 0, function() heli:Remove() end ) end hook.Add("InitPostEntity", "heli", heli ) timer.Create( "Heli", 60, 0, heli )
So any help is appreciated Thanks.
(Also I know that timer is not 30 minutes, it’s for debugging.)