ralke
(҂ ͠❛ ෴ ͡❛)ᕤ
Hi! I have this script to send an effect when player has a "full set".
Someone can convert it to 1.4?, if possible have multiple sets registered in the same script and give different bonus on each set.
Ex. If player has full golden set, send effect "golden", give +3 defence , if demon, send effect "demon", give +3 sword and so on.
Here is the script
Also need to ask, sending a globalevent with this will reduce server performance?
Regards!
Someone can convert it to 1.4?, if possible have multiple sets registered in the same script and give different bonus on each set.
Ex. If player has full golden set, send effect "golden", give +3 defence , if demon, send effect "demon", give +3 sword and so on.
Here is the script
Code:
local config = {
txt = 'DEMON', -- Texto animado que saldrá.
txtColor = COLOR_RED, -- Color del texto anterior.
set = { -- Equipamento que componga el Set.
-- [Slot que ocupa en el Set] = ID del equipamento,
[CONST_SLOT_HEAD] = 2493, -- Helmet
[CONST_SLOT_ARMOR] = 2494, -- Armor
[CONST_SLOT_LEGS] = 2495, -- Legs
},
weapons = {2520, 7382, 2421}, -- Posibles weapons que llevará en las manos.
}
local function isUsingSet(pid, set)
if not isPlayerGhost(pid) then
for slot, item_id in pairs(set) do
if getPlayerSlotItem(pid, slot).itemid ~= item_id then
return false
end
end
end
return true
end
function onThink(interval)
for _, name in ipairs(getOnlinePlayers()) do
local pid = getPlayerByName(name)
local pos = getPlayerPosition(pid)
if isUsingSet(pid, config.set) then
if isInArray(config.weapons, getPlayerSlotItem(pid, CONST_SLOT_LEFT).itemid) or isInArray(config.weapons, getPlayerSlotItem(pid, CONST_SLOT_RIGHT).itemid) then
doSendAnimatedText(pos, config.txt, config.txtColor)
end
end
end
return true
end
Also need to ask, sending a globalevent with this will reduce server performance?
Regards!