B7raani Posted August 11, 2012 Share Posted August 11, 2012 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
top sniper Posted August 11, 2012 Share Posted August 11, 2012 setPedRotation setPedAnimation Link to comment
top sniper Posted August 11, 2012 Share Posted August 11, 2012 setPedRotation setPedAnimation getElementPosition to the player ho Damage Link to comment
DiSaMe Posted August 11, 2012 Share Posted August 11, 2012 Use these functions: setPedControlState setPedAimTarget Link to comment
B7raani Posted August 11, 2012 Author Share Posted August 11, 2012 thanks much guys for the help Link to comment
B7raani Posted August 11, 2012 Author Share Posted August 11, 2012 [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
Castillo Posted August 11, 2012 Share Posted August 11, 2012 That has many problems. You could instead the resource: "slothbot", which let's you create bots that can fire to a specified team. Link: https://community.multitheftauto.com/ind ... ils&id=672 Link to comment
TAPL Posted August 11, 2012 Share Posted August 11, 2012 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 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
B7raani Posted August 11, 2012 Author Share Posted August 11, 2012 thanks solid you always help Link to comment
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