Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local testmodule = {}
- function testmodule.tick()
- local playerPed = PLAYER.PLAYER_PED_ID()
- local player = PLAYER.GET_PLAYER_PED(playerPed)
- local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
- if(PLAYER.IS_PLAYER_ONLINE() and playerExists) then
- if(get_key_pressed(114)) then
- local playerPed = PLAYER.PLAYER_PED_ID();
- local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);
- local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);
- local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());
- PED.SET_PED_AS_GROUP_MEMBER(clone, group);
- AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);
- PED.SET_PED_KEEP_TASK(clone, true);
- WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 5, true);
- ENTITY.SET_ENTITY_INVINCIBLE(clone, false);
- end
- end
- end
- return testmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement