Jump to content

Need Help In Making Ped Fire On Who Attacks Them


B7raani

Recommended Posts

Hey Guys

i need help in making peds attacking who attacks them i already placed them and gave them weapons but i want them to attack who attacks them

This Is My Lua File

function pedLoad() 
  
  
  
    ped1 = createPed ( 165, 1240.8000488281, -2054.100091656563, 60 , -80 ) 
  
        setTimer( giveWeapon, 1000, 1, ped1, 31, 500, true) 
  
        setPedWeaponSlot ( ped1, 5 ) 
         
         
  
  
  
end 
  
  
  
addEventHandler ( "onResourceStart", getRootElement(), pedLoad ) 

And This One Is The Meta.xml

    "B7raani" type="script" version="1.0" description="Ped Creating" /> 
    

I Wish you help me soon you can.

and thanks

Link to comment

[lua]function pedLoad()

ped1 = createPed ( 165, 1240.8000488281, -2054.100091656563, 60 , -80 )

setTimer( giveWeapon, 1000, 1, ped1, 31, 500, true)

setPedWeaponSlot ( ped1, 5 )

setPedAimTarget ( ped1, 10, 10, 5 )

bool setPedControlState ( ped thePed, string control, bool state )

end

addEventHandler ( "onResourceStart", getRootElement(), pedLoad )

[lua]

Guys see i made what you told me about setPedControlState

And SetPedAimTarget But It wont work please help

Link to comment

You copying the wiki syntax :?

it's already won't work because it's Client-only function and your script is server side, you need trigger and much work.

i don't understand why you have huge spaces in your code :roll:

when i saw your code i was think to not read it because of the huge spaces.

in future please try to remove these spaces that does not have any benefit.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...