Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local testmodule = {}
  2.  
  3. function testmodule.tick()
  4. local playerPed = PLAYER.PLAYER_PED_ID()
  5. local player = PLAYER.GET_PLAYER_PED(playerPed)
  6. local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
  7. if(PLAYER.IS_PLAYER_ONLINE() and playerExists) then
  8. if(get_key_pressed(114)) then
  9. local playerPed = PLAYER.PLAYER_PED_ID();
  10. local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);
  11. local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);
  12. local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());
  13. PED.SET_PED_AS_GROUP_MEMBER(clone, group);
  14. AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);
  15. PED.SET_PED_KEEP_TASK(clone, true);
  16. WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 5, true);
  17. ENTITY.SET_ENTITY_INVINCIBLE(clone, false);
  18.  
  19. end
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. end
  27. end
  28.  
  29. return testmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement