DarkNeSsOak Posted April 11, 2017 Share Posted April 11, 2017 (edited) Ayuda por favor, al matar al "hades" salga por un cierto tiempo el segundo "crazy" sin que respawnee de nuevo al boss "hades" hasta matar al boss "crazy", no logro hacerlo sin que me salga bien solo cuando mato al primero sale los 2 al mismo tiempo que le puse (60 segundos). Server side: function boss0 ( ) hades = exports [ "slothBot" ]:spawnBot ( 1184.654, -2038.601, 69.008, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) exports.extra_health:setElementExtraHealth(hades, 1000) setElementModel ( hades, 38 ) setElementData (hades, "boss", true) outputChatBox ("#9E0000Boss Hades!!",getRootElement(), 255, 255, 255, true ) end addEventHandler("onResourceStart", resourceRoot, boss0) --Boss1 function Boss1 ( ) crazy = exports [ "slothBot" ]:spawnBot ( 1262.77, -2029.756, 59.341, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) exports.extra_health:setElementExtraHealth(crazy, 1000) setElementModel ( crazy, 312 ) setElementData (crazy, "boss", true) end function money (theKiller) if getElementData(source,"boss")==true then local premio = math.random(1000,5000) givePlayerMoney(theKiller,premio) outputChatBox ( getPlayerName ( theKiller ) .. " #081DBFMato al Boss!, Ha Ganado $".. premio .." platica :v",getRootElement(), 255, 255, 255, true ) if source == hades then setTimer(boss0, 60000, 1) end if (not isElement(crazy)) then setTimer(Boss1, 60000, 1) end end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement(), money) Edited April 11, 2017 by DarkNeSsOak Link to comment
#Dv^ Posted April 12, 2017 Share Posted April 12, 2017 (edited) Modificá a tu gusto addEventHandler("onResourceStart", resourceRoot, function() if not isElement(crazy) and not isElement(hades) then spawnBot_Crazy() end end ) function spawnBot_Crazy() if not isElement(crazy) then crazy = exports["slothBot"]:spawnBot( 1262.77, -2029.756, 59.341, 90,math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true) --exports.extra_health:setElementExtraHealth(crazy, 1000) setElementModel ( crazy, 312 ) outputChatBox("Apareció el Boss Crazy!") end end function spawnBot_Hades() if not isElement(hades) then hades = exports [ "slothBot" ]:spawnBot ( 1262.77, -2029.756, 59.341, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) --exports.extra_health:setElementExtraHealth(hades, 1000) setElementModel ( hades, 38 ) outputChatBox("Apareció el Boss Hades!") end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", root, function (attacker) if attacker then if attacker ~= source then if getElementType(attacker) == "player" then if isElement(crazy) then givePlayerMoney(attacker, math.random(1000, 5000)) outputChatBox("Muerto Crazy") setTimer(spawnBot_Hades, 10000, 1) end if isElement(hades) then givePlayerMoney(attacker, math.random(1000, 5000)) outputChatBox("Muerto Hades") setTimer(spawnBot_Crazy, 60000, 1) end end end end end ) addEventHandler("onResourceStop", resourceRoot, function() if isElement(crazy) then destroyElement(crazy) end if isElement(hades) then destroyElement(hades) end end ) Edited April 12, 2017 by #Dv^ Variable incorrecta 1 Link to comment
DarkNeSsOak Posted April 13, 2017 Author Share Posted April 13, 2017 @ #Dv^ Muchísimas gracias por tu ayuda :D!!! Link to comment
DarkNeSsOak Posted April 13, 2017 Author Share Posted April 13, 2017 @#Dv^ Como haría para poner 3 y cuando muera el tercero aparezca el Primero? Link to comment
Recommended Posts