Sign in to follow this  
DarkNeSsOak

[Ayuda] Boss Settimer

Recommended Posts

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 by DarkNeSsOak

Share this post


Link to post

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 by #Dv^
Variable incorrecta
  • Like 1

Share this post


Link to post
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.