Advertisement
Guest User

Untitled

a guest
Aug 19th, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. function newPickups.tick()
  2. newPickups.currentTime = GAMEPLAY.GET_GAME_TIMER()
  3. newPickups.playerExists = ENTITY.DOES_ENTITY_EXIST(PLAYER.PLAYER_PED_ID())
  4.  
  5. if(newPickups.playerExists == true) then
  6.  
  7. if((newPickups.currentTime - newPickups.checkTime) > newPickups.replenishInterval) then
  8. newPickups.checkTime = newPickups.currentTime
  9. newPickups.spawnPickups = true
  10. end
  11.  
  12. if(newPickups.spawnPickups == true) then
  13.  
  14. if(newPickups.firstRun) then
  15. for i, coords in pairs(newPickups.armorLocations) do
  16. newPickups.armorObjects[i] = OBJECT.CREATE_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"), coords[1], coords[2], coords[3], 0, 1, false, GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"))
  17. newPickups.firstRun = false
  18. newPickups.logAction("New Pickup Spawned x:" .. coords[1] .. ",y:" .. coords[2] .. ",z:" .. coords[3])
  19. end
  20. else
  21. for i, coords in pairs(newPickups.armorLocations) do
  22. if(OBJECT.DOES_PICKUP_OBJECT_EXIST(newPickups.armorObjects[i]) == false) then
  23. newPickups.armorObjects[i] = OBJECT.CREATE_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"), coords[1], coords[2], coords[3], 0, 1, false, GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"))
  24. newPickups.logAction("New Pickup Spawned x:" .. coords[1] .. ",y:" .. coords[2] .. ",z:" .. coords[3])
  25. else
  26. newPickups.logAction("Pickup Already Exists At x:" .. coords[1] .. ",y:" .. coords[2] .. ",z:" .. coords[3])
  27. end
  28. end
  29. end
  30.  
  31. newPickups.spawnPickups = false
  32. end
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement