DarkNeSsOak Posted September 22, 2016 Share Posted September 22, 2016 Hola, este script es el conocido Boss que lo busque en el mta resources, bueno mi problema es que spawnea todo bien pero no le ajusta el extra health y le da muy poca vida y el icono del mapa no se elimina al matar al boss espero que me puedan ayudar aca esta el client Just now, DarkNeSsOak said: Hola, este script es el conocido Boss que lo busque en el mta resources, bueno mi problema es que spawnea todo bien pero no le ajusta el extra health y le da muy poca vida y el icono del mapa no se elimina al matar al boss espero que me puedan ayudar aca esta el client local function nemesi ( ) nemesi = exports [ "slothBot" ]:spawnBot ( 1124.9117431641, -2036.8974609375, 69.882827758789, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 308 ) outputChatBox ("#880000[EVENTO] #555555MIRA EL PUNTO ROJO Y MATA AL BOSS!!!!",getRootElement(), 255, 255, 255, true ) local myBlip = (createBlipAttachedTo ( nemesi, 23 )) triggerClientEvent ( "nsound", root ) triggerClientEvent ( "nemesismissel", root ) setTimer( function() exports.extra_health:setElementExtraHealth(nemesi, 10000) end, 1100, 0) end addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan) addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement) function money (theKiller) if (source == nemesi) then givePlayerMoney(theKiller,math.random(15000)) outputChatBox ( getPlayerName ( theKiller ) .. " #081DBFHa matado al BOSS!Se le ha dado #550000$15.000 #081DBFcomo recompensa",getRootElement(), 255, 255, 255, true ) 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
#Dv^ Posted September 27, 2016 Share Posted September 27, 2016 Esto va del lado del servidor, no del cliente. Postea tu meta.xml Link to comment
Anzo Posted September 27, 2016 Share Posted September 27, 2016 8 hours ago, Slash14 said: Esto va del lado del servidor, no del cliente. Postea tu meta.xml Aunque este del lado del servidor no iba a funcionar, el problema era que estaba usando variables locales cuando tenía que usar globales... Así funcionaria bien: local nemesi local myBlip local setHealth = 10000 function spawnNemesis ( ) nemesi = exports [ "slothBot" ]:spawnBot ( 1124.9117431641, -2036.8974609375, 69.882827758789, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 308 ) outputChatBox ("#880000[EVENTO] #555555MIRA EL PUNTO ROJO Y MATA AL BOSS!!!!",getRootElement(), 255, 255, 255, true ) myBlip = (createBlipAttachedTo ( nemesi, 23 )) --triggerClientEvent ( "nsound", root ) --triggerClientEvent ( "nemesismissel", root ) exports.extra_health:setElementExtraHealth(nemesi, setHealth) end addEventHandler("onResourceStart", resourceRoot, spawnNemesis) function money (theKiller) if (source == nemesi) then if (theKiller) then if (isElement(theKiller) == true) then if (getElementType(theKiller) == "player") then givePlayerMoney(theKiller,math.random(10000, 15000)) outputChatBox ( getPlayerName ( theKiller ) .. " #081DBFHa matado al BOSS!Se le ha dado #550000$15.000 #081DBFcomo recompensa",getRootElement(), 255, 255, 255, true ) timer = setTimer(spawnNemesis, 60000, 1) end end end destroyElement(myBlip) end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement(), money) addEventHandler("onResourceStop",resourceRoot,function() killPed(nemesi) end) Link to comment
DarkNeSsOak Posted September 27, 2016 Author Share Posted September 27, 2016 10 hours ago, Anzo said: Aunque este del lado del servidor no iba a funcionar, el problema era que estaba usando variables locales cuando tenía que usar globales... Así funcionaria bien: local nemesi local myBlip local setHealth = 10000 function spawnNemesis ( ) nemesi = exports [ "slothBot" ]:spawnBot ( 1124.9117431641, -2036.8974609375, 69.882827758789, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 308 ) outputChatBox ("#880000[EVENTO] #555555MIRA EL PUNTO ROJO Y MATA AL BOSS!!!!",getRootElement(), 255, 255, 255, true ) myBlip = (createBlipAttachedTo ( nemesi, 23 )) --triggerClientEvent ( "nsound", root ) --triggerClientEvent ( "nemesismissel", root ) exports.extra_health:setElementExtraHealth(nemesi, setHealth) end addEventHandler("onResourceStart", resourceRoot, spawnNemesis) function money (theKiller) if (source == nemesi) then if (theKiller) then if (isElement(theKiller) == true) then if (getElementType(theKiller) == "player") then givePlayerMoney(theKiller,math.random(10000, 15000)) outputChatBox ( getPlayerName ( theKiller ) .. " #081DBFHa matado al BOSS!Se le ha dado #550000$15.000 #081DBFcomo recompensa",getRootElement(), 255, 255, 255, true ) timer = setTimer(spawnNemesis, 60000, 1) end end end destroyElement(myBlip) end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement(), money) addEventHandler("onResourceStop",resourceRoot,function() killPed(nemesi) end) no me funciona no aparece el blip ni el nemesis. Link to comment
Anzo Posted September 27, 2016 Share Posted September 27, 2016 (edited) A mi me funciona, algo debes estar haciendo mal. Mira a ver si da algún error en el debug porque eso debe funcionar. Edited September 27, 2016 by Anzo Link to comment
#Dv^ Posted September 28, 2016 Share Posted September 28, 2016 local hillRadar = createRadarArea ( 2520.1318359375, -953.83752441406, 200, 200, 181, 0, 0, 255 ) function Nemesisbymanawydan ( ) baz = createObject ( 360, 622.4934082031, -847.33459472656, 75.0484313964, 0, 0, 0 ) nemesi = exports [ "slothBot" ]:spawnBot ( 2622.4934082031, -847.33459472656, 75.048431396484, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 14 ) outputChatBox ("El boss apareció",getRootElement(), 255, 255, 255, true ) attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) x,y,z = getElementPosition ( nemesi ) miBlip = createBlip ( x, y, z, 0, 2, 255, 0, 0, miJugador ) end addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan) addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement) function money (theKiller) if (source == nemesi) then givePlayerMoney(theKiller,(3000)) outputChatBox ( "BOSS:".. getPlayerName ( theKiller ) .. " #FFFFFFmató al boss!",getRootElement(), 255, 255, 255, true ) outputChatBox ("BOSS: #FFFFFF: Me las pagarás ".. getPlayerName ( theKiller ) .. "",getRootElement(), 255, 255, 255, true ) setTimer(Nemesisbymanawydan, 240000, 1) destroyElement(miBlip) end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement(), money) Prueba con este, esto va del lado del servidor Link to comment
DarkNeSsOak Posted September 28, 2016 Author Share Posted September 28, 2016 Ya esta solucionado, ya muchas gracias! se los agradesco a todos los que me ayudaron, el script de Anzo me sirve estaba mal el meta y el de Slash14 tambien Link to comment
Recommended Posts