Jump to content

Make zombies shoot


Soren

Recommended Posts

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 ) 

Link to comment

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

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