Advertisement
Guest User

GTA5 Repair Script

a guest
May 25th, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. --All credit to soundjester @ gta5-mods.com for getting us this far.
  2.  
  3. local car ={}
  4.  
  5. local function inTable(tbl, item)
  6.     for key, value in pairs(tbl) do
  7.         if value == item then return true end
  8.     end
  9.     return false
  10. end
  11.  
  12. local function repairVeh(int)
  13.         VEHICLE.SET_VEHICLE_FIXED(int)
  14.         --Clean the car - dirtLvl = 0 (clean) to 15 (dirty)
  15.         VEHICLE.SET_VEHICLE_DIRT_LEVEL(int, 0)
  16.         --Lets make our car "not wanted" anymore as well
  17.         VEHICLE.SET_VEHICLE_IS_WANTED(int, false)
  18.     --Make sure we have bulletproof tyres
  19.     VEHICLE.SET_VEHICLE_TYRES_CAN_BURST(veh, false)
  20.     --Does this actually work? Tune in next week to find out!
  21.     VEHICLE.SET_VEHICLE_CAN_BE_VISIBLY_DAMAGED(veh, false)      
  22.         return
  23. end
  24.  
  25. function car.tick()  
  26.     local playerPed = PLAYER.PLAYER_PED_ID()
  27.         local player = PLAYER.GET_PLAYER_PED(playerPed)
  28.         local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
  29.         local myCar = PED.GET_VEHICLE_PED_IS_USING(player)
  30.         if(playerExists) then
  31.                 if(PED.IS_PED_IN_ANY_VEHICLE(playerPed, false)) then
  32.                         local veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)  
  33.  
  34.                         if(get_key_pressed(107))then
  35.  
  36.                             --And apply the magic sauce...
  37.                             repairVeh(veh)
  38.  
  39.                             local testmodule = {}                                                          
  40.                         end
  41.  
  42.                 end
  43.         end
  44. end
  45. return car
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement