Jump to content

[HELP] Respawn


opnaiC

Recommended Posts

function respawnBus (thePlayer) 
  local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
  local model = getElementModel(theVehicle) 
   if model == 431 then 
     if not getVehicleOccupants (theVehicle) then 
      setTimer (function () 
      respawnVehicle (theVehicle) 
      end, 5000, 1) 
     end 
   end  
end 
addEventHandler ("onVehicleExit", root, respawnBus) 

Bad Argument in 3 line. Got boolean

Link to comment

Use this:

function respawnBus (thePlayer) 
  local model = getElementModel(source) 
   if model == 431 then 
     if not getVehicleOccupants (source) then 
      setTimer (function () 
      respawnVehicle (source) 
      end, 5000, 1) 
     end 
   end  
end 
addEventHandler ("onVehicleExit", root, respawnBus) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...