Server side
local x,y,z = -2337.544921875, -1618.7431640625, 483.71304321289
local dimension = 0
local interior = 0
local teamEvento = createTeam ( "EventBoss", 0, 255, 255 )
function Nemesisbymanawydan (thePlayer)
nemesi = exports [ "slothBot" ]:spawnBot ( 2622.4934082031, -847.33459472656, 75.048431396484, 90, 0,0, 38, "hunting", true )
exports.extra_health:setElementExtraHealth(nemesi, 50)
outputChatBox ( "#00FFFFSự kiện BOSS #AAAAAA tham gia hãy gõ /event",source, 255, 255, 255, true )
outputChatBox ("#9E0000Nemesis: #9E0000 Grrr Grrr!",getRootElement(), 255, 255, 255, true )
setElementData ( nemesi, "alex", true )
end
addCommandHandler ("Boss", Nemesisbymanawydan)
function TODOSALTEAM()
local players = getElementsByType ( "player" ) -- get a table of all the players in the server
for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player
setPlayerTeam ( thePlayer, teamEvento )
end
end
addCommandHandler ("Boss", TODOSALTEAM)
function SpawnPlayer( thePlayer )
local localPlayerName = getPlayerName(thePlayer)
playerTeam = getPlayerTeam ( thePlayer )
Clan = getTeamFromName ( "Event" )
if not ( playerTeam ) == Clan then
spawnPlayer (thePlayer, -2315.7578125, -1641.7578125, 483.703125, 42, 15)
outputChatBox ( "#00ffff*".. localPlayerName .." #00ffffđã tham gia giết boss", source, 255, 255, 255, true )
else
outputChatBox ( "#00ffff*".. localPlayerName .." #FF0000đã chết và không thể tới giết boss thế giới!",source, 255, 255, 255, true )
end
end
addCommandHandler ("event", SpawnPlayer)
local Radar = createRadarArea ( -2374.2119140625, -1694.4833984375, 130, 150, 181, 0, 0, 170 )
local Area = createColRectangle ( -2374.2119140625, -1694.4833984375, 130, 150 )
local myBlip = createBlipAttachedTo ( nemesi, 23 )
function MuereSacaDelTeam ( source )
playerTeam = getPlayerTeam ( source )
Clann = getTeamFromName ( "EventBoss" )
if ( playerTeam ) == Clann then
setPlayerTeam ( source, nil )
end
end
addEventHandler ( "onColShapeLeave", Area, MuereSacaDelTeam )
function kill( thePlayer )
killPed(thePlayer)
end
addEventHandler ( "onColShapeLeave", Area, kill )
function restartBot (ped,commando)
local allBots = getElementsByType ( "ped" )
for index, boss in pairs(allBots) do
killPed(boss)
end
end
addCommandHandler("killboss",restartBot)
addEvent("onBotWasted")
addEventHandler( "onBotWasted", getRootElement(),
function (attacker, weapon, bodypart)
if getElementType(attacker)== "player" and (source == boss1) then
outputChatBox("* #FFFFFF¡"..getPlayerName(attacker).." #FFFFFFđã hạ gục #00FF00Boss#FFFFFF!", getRootElement(), 0, 255, 0, true)
end
end)
function destroy ()
if ( not isElement ( nemesi ) ) then
destroyElement(myBlip)
end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), destroy)
Client Side
function nemesi ( attacker, weapon, bodypart )
if (attacker) then
if (getElementData (attacker, "nemesi") == true) then
triggerServerEvent("KillByAlex",source,attacker)
end
end
end
addEventHandler ( "onClientPlayerDamage",root, nemesi )