Jump to content

COmo poner AI al script de ped


Julian09123

Recommended Posts

Osea ya tengo el script de ped pero nose como hacer para q tenga AI osea funcion para que, el ped te sigua hasta matarte

Client:

ped createPed ( int modelid, float 2194, float -1747, float 17 [, float rot = 0.0 ] ) 

Server:

ped = createPed ( skin, X, Y, Z, R) 
   addCommandHandler( "give", 
  function ( player, command, id, amount ) 
    if not tonumber ( id ) then return end 
  
    if not tonumber ( amount ) then 
        amount = 9001 
    end 
  
    giveWeapon( ped, id, amount, true ) 
  end 
) 
  
function makePed() 
   ped1 = createPed(skin, X, Y, Z) 
   setPedRotation(ped1, R) 
   setPedAnimation( ped1, "AnimationSection", "Animation") 
end 
addCommandHandler("Pedsappearswhitcommandhere", makePed) 
  

Link to comment

Tengo u problema Pongo start a todo

Y me dice

en la console

Warning: nemesis/nemesis11.lua:12: Bad Argument SetElementHealth

y lo tengo haci

function Nemesisbymanawydan ( )   
       baz = createObject ( 360, -1935.5480957031, 665.44055175781, 48, 0, 0, 0 ) 
       nemesi = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90,  math.random ( 300, 303 ), 0, 0, Nemesis, 38,         "hunting", true ) 
      setElementModel ( nemesi, 107 ) 
      outputChatBox ("#9E0000Nemesis: #0D9905Perras las matare, Si bienen!",getRootElement(), 255, 255, 255, true ) 
      local myBlip = (createBlipAttachedTo ( nemesi, 0 )) 
      attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) 
      triggerClientEvent ( "nsound", root )     
      triggerClientEvent ( "nemesismissel", root ) 
      setTimer( 
      function() 
      setElementHealth ( Nemesis, 900 ) 
      end, 1100, 0) 
 end 
addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)    
  
addEvent("onBotWasted",true) 
addEventHandler("onBotWasted",getRootElement(), 
function (killer) 
if (source == nemesi) then 
givePlayerMoney(killer,math.random(4000,6000)) -- 120000, 150000 money for kill nemesis-- 
outputChatBox ( getPlayerName ( killer ) .. " #081DBFkilled Nemesis, congratulations",getRootElement(), 255, 255, 255, true ) 
setTimer(Nemesisbymanawydan, 1000, 1) -- 60000 time for nemesis respawn in milliseconds-- 
end 
end) 

Link to comment

Tenes que usar el extra_health de Castillo(SolidSnake14)

[url=https://community.multitheftauto.com/index.php?p=resources&s=details&id=5195]https://community.multitheftauto.com/index.php?p= ... ls&id=5195[/url] 

function Nemesisbymanawydan ( )   
       baz = createObject ( 360, -1935.5480957031, 665.44055175781, 48, 0, 0, 0 ) 
       nemesi = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90,  math.random ( 300, 303 ), 0, 0, Nemesis, 38,         "hunting", true ) 
      setElementModel ( nemesi, 107 ) 
      outputChatBox ("#9E0000Nemesis: #0D9905Perras las matare, Si bienen!",getRootElement(), 255, 255, 255, true ) 
      local myBlip = (createBlipAttachedTo ( nemesi, 0 )) 
      attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) 
      triggerClientEvent ( "nsound", root )     
      triggerClientEvent ( "nemesismissel", root ) 
      setTimer( 
      function() 
      exports.extra_health:setElementExtraHealth(nemesi, 900) -- es para darle mas de 200 de vida con el setElementHealth le podes dar 200 nada mas 
      end, 1100, 0) 
 end 
addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)   
  
addEvent("onBotWasted",true) 
addEventHandler("onBotWasted",getRootElement(), 
function (killer) 
if (source == nemesi) then 
givePlayerMoney(killer,math.random(4000,6000)) -- 120000, 150000 money for kill nemesis-- 
outputChatBox ( getPlayerName ( killer ) .. " #081DBFkilled Nemesis, congratulations",getRootElement(), 255, 255, 255, true ) 
setTimer(Nemesisbymanawydan, 1000, 1) -- 60000 time for nemesis respawn in milliseconds-- 
end 
end) 

Link to comment
  • Recently Browsing   0 members

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