Advertisement
Smokahontas

MTA TROLL Respawn and Explode all Vehicles

Aug 21st, 2022 (edited)
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. -- Created by Smokahontas.
  2. function respawnVehicles()
  3.     for index, vehicle in pairs(getElementsByType("vehicle")) do
  4.         local x, y, z = getElementPosition(vehicle)
  5.         local rx, ry, rz = getElementRotation(vehicle)
  6.         local model = getElementModel(vehicle)
  7.         local numberplate = getVehiclePlateText(vehicle)
  8.         local color1, color2 = getVehicleColor(vehicle)
  9.         local health = getElementHealth(vehicle)
  10.         destroyElement(vehicle)
  11.         local nVehicle = createVehicle(model, x, y, z, rx, ry, rz, numberplate)
  12.         setVehicleColor(nVehicle, color1, color2, color1, color2)
  13.         setElementHealth(nVehicle, 0)
  14.     end
  15. end
  16. respawnVehicles()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement