Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. local riftmodule = {}
  2. riftmodule.loaded = false
  3. riftmodule.zombies = {}
  4. function riftmodule.unload()
  5.  
  6. end
  7. function riftmodule.tick()
  8.     if(not riftmodule.loaded) then
  9.  
  10.  
  11.         print("Module Loaded")
  12.  
  13.         riftmodule.loaded = true
  14.     end
  15.  
  16.  
  17.     if(get_key_pressed(117)) then
  18.  
  19.         local nearby_peds = {}
  20.  
  21.         local nearby_ped_count = PED.GET_PED_NEARBY_PEDS(PLAYER.PLAYER_PED_ID, nearby_peds, -1)
  22.  
  23.         if (nearby_ped_count > 0) then
  24.             for k, v in ipairs(nearby_peds) do
  25.                 math.randomseed( os.time() )       
  26.                 PED.SET_PED_MONEY(v, math.random(1000,20000));
  27.             end
  28.         end
  29.  
  30.  
  31.     end
  32.  
  33.     if(get_key_pressed(116)) then
  34.  
  35.         local playerPed = PLAYER.PLAYER_PED_ID();
  36.         local player = PLAYER.GET_PLAYER_PED(playerPed);
  37.         local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed);
  38.         local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);
  39.         local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z); --PED.CLONE_PED(playerPed, coords.x, coords.y, coords.z);
  40.  
  41.         local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());
  42.         PED.SET_PED_AS_GROUP_MEMBER(clone, group);
  43.         AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);
  44.         PED.SET_PED_KEEP_TASK(clone, true);
  45.         PED.SET_PED_MONEY(clone, 10000);
  46.         WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 1000, true);
  47.         ENTITY.SET_ENTITY_INVINCIBLE(clone, false);
  48.  
  49.  
  50.  
  51.     end
  52.  
  53.     --print("Hello World! 2")
  54.    
  55. end
  56.  
  57. return riftmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement