Jump to content

[Ayuda] Slothbot Habilidades


Narutimmy

Recommended Posts

Posted

Hola, me preguntaba.... como puedo hacer que un slothbot tenga cosas como superfuerza para que mate de 1 golpe? y que ademas sea muy rapido?

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
bueno para eso tienes que usar getElementType o getElementData para saber quién te atacó. y luego usar setElementHealth .

SV:

--KILL FROM Tyrant ATTACK 
addEvent( "playereaten2", true ) 
function Playerinfected2 ( player, attacker, weapon, bodypart) 
    killPed ( player, attacker, weapon, bodypart ) 
end 
addEventHandler( "playereaten2", getRootElement(), Playerinfected2 ) 

Cl:

--Matar Tyrant 
function tirantattack ( attacker, weapon, bodypart ) 
    if (attacker) then 
        if getElementType ( attacker ) == "ped" then 
            if (getElementData (attacker, "tyrant") == true) then 
                local playerHealth = getElementHealth ( getLocalPlayer() ) 
                if playerHealth > 15 then 
                    setElementHealth ( source, playerHealth - 500 ) 
                else 
                    triggerServerEvent ("playereaten2", source, source, attacker, weapon, bodypart ) 
                end 
            end 
        end 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), tirantattack ) 

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
Que quieres hacer exactamente? Que cuando un slothBot te toque , te quite mas vida de lo normal?

si que con 1 golpe te deje en 0 y mueras.

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Probalo asi , no se si funcionara porque lo hice asi nomas xD

local gMe = getLocalPlayer() 
  
function bot ( attacker ) 
     if ( getElementType ( attacker ) == "ped" ) then 
         local vida = getElementHealth(gMe) 
             if ( vida >= 0 ) then 
             killPed ( source ) 
         end 
    end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

Ponelo como server.

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted
Probalo asi , no se si funcionara porque lo hice asi nomas xD
local gMe = getLocalPlayer() 
  
function bot ( attacker ) 
     if ( getElementType ( attacker ) == "ped" ) then 
         local vida = getElementHealth(gMe) 
             if ( vida >= 0 ) then 
             killPed ( source ) 
         end 
    end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

Ponelo como server.

2 cosas, borro lo anterior y es para el slothbot nadamas verdad?

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
Que borras? El slothBot es solo un ped.

que si borro el scrip que habia echo y dejo solo el tuyo?

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
Pues Si.

No Funciono, este es el scrip que uso para el BOSS

--Tyrant 
local colshape = createColRectangle ( 88.4608, 1779.9825, 400, 400 ) 
zombiesMatados = 0 
function zona2 ( ) 
    if ( isElementWithinColShape ( source, colshape ) ) then 
zombiesMatados = ( zombiesMatados + 1 ) 
if ( zombiesMatados == 1 ) then -- ACA DONDE DICE =1 pone la cantidad de zombies que tienen que matar para que aparesca 
if ( not isElement ( tyrant ) ) then 
        tyrant = exports [ "slothbot" ]:spawnBot ( 249.1348, 1820.0046, 9, 90, 146, 0, 0, ex, 0, "hunting", true ) 
        exports.extra_health:setElementExtraHealth ( tyrant, 20000 ) 
        setGameSpeed ( tyrant, 5) 
outputChatBox ( "#ff0000Tyrant a Spawneado, Corre!", getRootElement(), 255, 255, 255, true ) 
onZomieWasted = 75 
myBlip = createBlipAttachedTo ( tyrant, 23 ) 
  
         end 
      end 
   end 
end 
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", getRootElement(), zona2 ) 
  
local gMe = getLocalPlayer() 
  
 ---mata 
function bot ( attacker ) 
     if ( getElementType ( attacker ) == "ped" ) then 
         local vida = getElementHealth(gMe) 
             if ( vida >= 0 ) then 
             killPed ( source ) 
         end 
    end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Poro te dice algo el debug script?.

Probalo asi.

function bot ( attacker ) 
if ( getElementType ( attacker ) == "ped" ) and  ( getElementModel ( attacker ) == "el ID" ) then -- si no sirve ped probale tyrant. 
killPed(source) 
end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

@NOD getElementModel devuelve un int, no un string.

local gMe = getLocalPlayer() 
  
function bot ( attacker ) 
     if ( getElementType ( attacker ) == "ped" ) then 
         local vida = getElementHealth(gMe) 
             if ( vida >= 0 ) then 
             killPed ( source ) 
         end 
    end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

onPlayerDamage es server, killPed es server pero getLocalPlayer es client.

y para no parecer criticon:

function bot ( attacker ) 
  if attacker == tyrant then --Creo que 'tyrant' es la variable de tu 'BOSS' 
             killPed ( source, attacker ) 
         end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

PD: Si te da errores cuando un jugador se daña sin atacante, ponle una linea extra comprobando que si haya uno.

Developer @ MYVAL

Posted
@NOD getElementModel devuelve un int, no un string.
local gMe = getLocalPlayer() 
  
function bot ( attacker ) 
     if ( getElementType ( attacker ) == "ped" ) then 
         local vida = getElementHealth(gMe) 
             if ( vida >= 0 ) then 
             killPed ( source ) 
         end 
    end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

onPlayerDamage es server, killPed es server pero getLocalPlayer es client.

y para no parecer criticon:

function bot ( attacker ) 
  if attacker == tyrant then --Creo que 'tyrant' es la variable de tu 'BOSS' 
             killPed ( source, attacker ) 
         end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 

PD: Si te da errores cuando un jugador se daña sin atacante, ponle una linea extra comprobando que si haya uno.

error call local player algo asi sale en el debug

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Deberás ser mas especifico para saber cual es el error.

Aunque quizá diga algo como: 'ERROR: cal global 'getLocalPlayer' a nil value' o algo así, eso es por usar una función en el lado incorrecto.

Si es así entonces pusiste mal mi código, el caso era que borraras lo de @NOD y dejaras solo mi código y el tuyo:

--Tyrant 
local colshape = createColRectangle ( 88.4608, 1779.9825, 400, 400 ) 
zombiesMatados = 0 
function zona2 ( ) 
    if ( isElementWithinColShape ( source, colshape ) ) then 
zombiesMatados = ( zombiesMatados + 1 ) 
if ( zombiesMatados == 1 ) then -- ACA DONDE DICE =1 pone la cantidad de zombies que tienen que matar para que aparesca 
if ( not isElement ( tyrant ) ) then 
        tyrant = exports [ "slothbot" ]:spawnBot ( 249.1348, 1820.0046, 9, 90, 146, 0, 0, ex, 0, "hunting", true ) 
        exports.extra_health:setElementExtraHealth ( tyrant, 20000 ) 
        setGameSpeed ( tyrant, 5) 
outputChatBox ( "#ff0000Tyrant a Spawneado, Corre!", getRootElement(), 255, 255, 255, true ) 
onZomieWasted = 75 
myBlip = createBlipAttachedTo ( tyrant, 23 ) 
  
         end 
      end 
   end 
end 
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", getRootElement(), zona2 ) 
  
function bot ( attacker ) 
  if attacker == tyrant then --Creo que 'tyrant' es la variable de tu 'BOSS' 
             killPed ( source, attacker ) 
         end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 
  

Developer @ MYVAL

Posted
Deberás ser mas especifico para saber cual es el error.

Aunque quizá diga algo como: 'ERROR: cal global 'getLocalPlayer' a nil value' o algo así, eso es por usar una función en el lado incorrecto.

Si es así entonces pusiste mal mi código, el caso era que borraras lo de @NOD y dejaras solo mi código y el tuyo:

--Tyrant 
local colshape = createColRectangle ( 88.4608, 1779.9825, 400, 400 ) 
zombiesMatados = 0 
function zona2 ( ) 
    if ( isElementWithinColShape ( source, colshape ) ) then 
zombiesMatados = ( zombiesMatados + 1 ) 
if ( zombiesMatados == 1 ) then -- ACA DONDE DICE =1 pone la cantidad de zombies que tienen que matar para que aparesca 
if ( not isElement ( tyrant ) ) then 
        tyrant = exports [ "slothbot" ]:spawnBot ( 249.1348, 1820.0046, 9, 90, 146, 0, 0, ex, 0, "hunting", true ) 
        exports.extra_health:setElementExtraHealth ( tyrant, 20000 ) 
        setGameSpeed ( tyrant, 5) 
outputChatBox ( "#ff0000Tyrant a Spawneado, Corre!", getRootElement(), 255, 255, 255, true ) 
onZomieWasted = 75 
myBlip = createBlipAttachedTo ( tyrant, 23 ) 
  
         end 
      end 
   end 
end 
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", getRootElement(), zona2 ) 
  
function bot ( attacker ) 
  if attacker == tyrant then --Creo que 'tyrant' es la variable de tu 'BOSS' 
             killPed ( source, attacker ) 
         end 
end 
addEventHandler("onPlayerDamage", getRootElement(), bot) 
  

Si es justo ese error.

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
Si, justo lo que pensaba, intenta con el código como te lo deje.

Ya mata de 1 solo Golpe, el problema es que en ocaciones los usuarios mueren sin razon, salde junto a el y mori.

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
Que raro, porque la unica manera de que el player muera ( en este script ) es que el SlothBot te toque.

Si en ocaciones si saltas cercas del el mueres.

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

  • Recently Browsing   0 members

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