KariiiM Posted February 3, 2016 Posted February 3, 2016 when i did, the players told me that they see ped just moving, can't see ped have any weapon. function cmdArmedPed(player,_) local x, y, z = getElementPosition(player) -- Get your position local thePed = createPed(0, x + 1, y, z) -- Create a CJ ped nearby setTimer ( function ( ped ) giveWeapon( ped, 31, 5000, true) -- Give him 5000 rounds of M4 -- Make him shoot continuously triggerClientEvent(root,"onPedShoot",root,ped) end, 100, 1, thePed ) end addCommandHandler("armedped", cmdArmedPed)
Bonus Posted February 3, 2016 Posted February 3, 2016 Use onClientElementStreamIn on the triggered ped and use givePedWeapon and setPedControlState there. addEvent("onPedShoot",true) addEventHandler("onPedShoot",root, function (ped) setPedControlState( ped, "fire", true) addEventHandler ( "onClientElementStreamIn", ped, function () givePedWeapon ( source, 31, 5000, true ) setPedControlState ( source, "fire", true ) end) Edit: Its onClientElementStreamIn, not StreamedIn Update it
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now