Jump to content

Make zombies shoot


Soren

Recommended Posts

Posted

Hi all, I found the way to give to the zombies weapons but i want to give them a fire weapon (Ak-47, M4, etc) and make the shoot it. I give them the weapon but they dont shoot. Somebody know how to?

Posted

Is really simple to use it, here I'll leave a example.

https://wiki.multitheftauto.com/wiki/Slothman/Slothbot

function spawnSlothBot(thePlayer, cmd, skin, weapon, mode, rot, team) 
    local x, y, z = getElementPosition (thePlayer) 
    local rot = tonumber(rot) or 0 
    local team = getTeamFromName(team) 
    local int = getElementInterior(thePlayer) 
    local dim = getElementDimension(thePlayer) 
    local weapon = tonumber(weapon) or 0 
    local skin = tonumber(skin) or 0 
    exports["slothbot"]:spawnBot( x, y+1, z, rot, skin, int, dim, team, weapon, mode or "hunting", true ) 
end 
addCommandHandler ( "spawnbot", spawnSlothBot ) 

Posted

Ok, thats a example, i dint understand it at all, it suposed to create a ped in the position i put? Any example how to do it with a zombie?

Posted

ok i take a time to read the wiki again and the script you put there is a hunt slothbot that will hunt you ok,

How can i make to spawn lots of slothbots in the map?

Posted

it will spawn only 1 both? or many boths? far as i know your script will spawn 1 both in the place the player is?

Posted

*facepalm*

Please review the script.. As you see in this line

     local x, y, z = getElementPosition (thePlayer) -- We get your coordinates and store them in x,y,z.  

And in this one :

exports["slothbot"]:spawnBot( x, y+1, z, rot, skin, int, dim, team, weapon, mode or "hunting", true ) -- Here we call the x,y,z to spawn them , but , the bot won't spawn where are you because of this "y+1" , he will spawn one y coordinate away from you. 

Happy ? ..

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...