Shayan816 Posted June 20, 2017 Share Posted June 20, 2017 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 and after 1 minute 2 Nemesis are being spawned.. here Spoiler 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
Hamatora Posted June 20, 2017 Share Posted June 20, 2017 (edited) 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 and after 1 minute 2 Nemesis are being spawned.. here Reveal hidden contents 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 June 20, 2017 by Hamatora Link to comment
Shayan816 Posted June 20, 2017 Author Share Posted June 20, 2017 sorry my bad, Thanks fixed Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now