Jump to content

Nemesis BUG


Recommended Posts

Hey, I have a problem. i have downloaded nemesis script from community and i spawned nemesis in dimension 300 and everything works well but when nemesis died in chat box the message is appearing 2 times like this 

Spoiler

mta-screen_2017-06-20_23-06-07.png

and after 1 minute 2 Nemesis are being spawned.. here

Spoiler

mta-screen_2017-06-20_23-05-52.png

Here is the code

 

 

function Nemesisbymanawydan ( )  
	baz = createObject ( 360, -1935.5480957031, 665.44055175781, 48, 0, 0, 0 )
    nemesi = exports [ "slothBot" ]:spawnBot ( 1143.8643798828, -2037.2325439453, 69.0078125, 90,  math.random ( 300, 303 ), 0, 300, Nemesis, 38, "hunting", true )
    setElementModel ( nemesi, 311 )
	BlipNemesis = createBlipAttachedTo ( nemesi, 23 )
    attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 )
    triggerClientEvent ( "nsound", root )
	setElementData(nemesi, "nemesis",true)
if nemesi then
  exports.extra_health:setElementExtraHealth ( nemesi, 5000 )
         end     
end
addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)  

addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement)
 
function money (theKiller)
if (source == nemesi) then
givePlayerMoney(theKiller,math.random(1000,2000))
outputChatBox ( getPlayerName ( theKiller ) .. "#081DBFHas Killed Nemesis Next Nemesis Will Spawn After 1 Minute",getRootElement(), 255, 255, 255, true )
destroyElement(BlipNemesis)
setTimer(Nemesisbymanawydan, 60000, 1)
end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), money)

function destroy ()
     if ( not isElement ( nemesi ) ) then
     destroyElement(myBlip)
     end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), destroy)

 

Link to comment
2 hours ago, Shayan816 said:

Hey, I have a problem. i have downloaded nemesis script from community and i spawned nemesis in dimension 300 and everything works well but when nemesis died in chat box the message is appearing 2 times like this 

  Reveal hidden contents

mta-screen_2017-06-20_23-06-07.png

and after 1 minute 2 Nemesis are being spawned.. here

  Reveal hidden contents

mta-screen_2017-06-20_23-05-52.png

Here is the code

 

 


function Nemesisbymanawydan ( )  
	baz = createObject ( 360, -1935.5480957031, 665.44055175781, 48, 0, 0, 0 )
    nemesi = exports [ "slothBot" ]:spawnBot ( 1143.8643798828, -2037.2325439453, 69.0078125, 90,  math.random ( 300, 303 ), 0, 300, Nemesis, 38, "hunting", true )
    setElementModel ( nemesi, 311 )
	BlipNemesis = createBlipAttachedTo ( nemesi, 23 )
    attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 )
    triggerClientEvent ( "nsound", root )
	setElementData(nemesi, "nemesis",true)
if nemesi then
  exports.extra_health:setElementExtraHealth ( nemesi, 5000 )
         end     
end
addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)  

addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement)
 
function money (theKiller)
if (source == nemesi) then
givePlayerMoney(theKiller,math.random(1000,2000))
outputChatBox ( getPlayerName ( theKiller ) .. "#081DBFHas Killed Nemesis Next Nemesis Will Spawn After 1 Minute",getRootElement(), 255, 255, 255, true )
destroyElement(BlipNemesis)
setTimer(Nemesisbymanawydan, 60000, 1)
end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), money)

function destroy ()
     if ( not isElement ( nemesi ) ) then
     destroyElement(myBlip)
     end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), destroy)

 

Working fine for me.

Spoiler

 

 

Edited by Hamatora
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...