Ir para conteúdo
  • 0

Erro Script Slot


surfnament

Pergunta

Ola...

Alguem poderia me ajudar com este script do slot system? Acredito que ele esteja pra TFS 1.1 , eu uso o TFS 1.0

 

erro:

https://uploaddeimagens.com.br/imagens/erro4-png--2

 

slot.lua

local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,300 do
conditionHP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionHP, CONDITION_PARAM_SUBID, 50)
setConditionParam(conditionHP, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(conditionHP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionHP, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+i)

conditionMP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMP, CONDITION_PARAM_SUBID, 51)
setConditionParam(conditionMP, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(conditionMP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionMP, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 100+i)

conditionML = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionML, CONDITION_PARAM_SUBID, 52)
setConditionParam(conditionML, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(conditionML, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionML, CONDITION_PARAM_STAT_MAGICPOINTSPERCENT, 100+i)


conditionCLUB = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionCLUB, CONDITION_PARAM_SUBID, 53)
setConditionParam(conditionCLUB, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(conditionCLUB, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_MELEEPERCENT, 100+i)


conditionSHI = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionSHI, CONDITION_PARAM_SUBID, 54)
setConditionParam(conditionSHI, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(conditionSHI, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionSHI, CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)

conditionDIST = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDIST, CONDITION_PARAM_SUBID, 55)
setConditionParam(conditionDIST, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(conditionDIST, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionDIST, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
end

function getSlotType(n)
if not n then
return false
end
if n:match('%[(.+)%]') then
n = n:match('%[(.+)%]')
if n == '?' then
return 0,n
else
return n:match('(.-)%.([+-])(%d+)%%')
end
else
return false
end
end

local function loadSet(cid)
local player = Player(cid)
if not player then return false end
local t = {}
for slot=1,9 do
t[slot] = ''
local s = getPlayerSlotItem(player,slot).uid
if s ~= 0 then
t[slot] = Item(s):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
end
end
return t
end

function chk(cid,f)
if not Player(cid) then return false end
local t = loadSet(cid)
if not t then return false end

for i=1,#f do
if f ~= t then
equip(player,nil,slot)
break
end
end
addEvent(chk,2000,cid,t)
end

function check_slot(aab, i)
if i == 5 or i == 6 then
if isWeapon(aab) or isShield(aab) or isBow(aab) then
return true
end
else
return true
end
return false
end

function equip(player,item,slot)
local t = {}
if item then
local mm,sinal,qto = getSlotType(Item(item.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION))
t[mm] = tonumber(qto)
end
for i=1,9 do
if i ~= slot then
if getPlayerSlotItem(player,i).itemid ~= 0 then
local aab = getPlayerSlotItem(player,i).uid
if aab and check_slot(aab,i) then
for _ in Item(aab):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gmatch('(%[.-%])') do
local mm,sinal,qto2 = getSlotType(_)
if mm then
if not t[mm] then
t[mm] = 0
end
t[mm] = t[mm]+tonumber(qto2)
t[mm] = t[mm] > 300 and 300 or t[mm]
end
end
end
end
end
end
local fu = 0
local ca = {}
local s = ''
for sl,n in pairs(t) do
fu = fu+1
s = s..''..n..'% more of '..sl..'\n'
if sl == 'hp' then
player:addCondition(conditionHP[tonumber(n)])
ca[50] = 1
doSendTutorial(player,19)
elseif sl == 'mp' then
player:addCondition(conditionMP[tonumber(n)])
ca[51] = 1
doSendTutorial(player,19)
elseif sl == 'ml' then
player:addCondition(conditionML[tonumber(n)])
ca[52] = 1
elseif sl == 'melee' then
player:addCondition(conditionCLUB[tonumber(n)])
ca[53] = 1
elseif sl == 'shield' then
player:addCondition(conditionSHI[tonumber(n)])
ca[54] = 1
elseif sl == 'dist' then
player:addCondition(conditionDIST[tonumber(n)])
ca[55] = 1
end
end
if fu > 0 then
for i=50,55 do
if not ca then
doRemoveCondition(player:getId(),CONDITION_ATTRIBUTES,i)
end
end
else
for i=50,55 do
doRemoveCondition(player:getId(),CONDITION_ATTRIBUTES,i)
end
end
return true
end

function onLogin(player)
equip(player,nil,slot)
local cid = player:getId()
addEvent(chk,2000,cid,loadSet(cid))
return true
end

 

 

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

Tenta ae:

 

 

local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,300 do
  conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50)
  setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+i)

  conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51)
  setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 100+i)

  conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52)
  setConditionParam(conditionML[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICPOINTSPERCENT, 100+i)


  conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_MELEEPERCENT, 100+i)


  conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)

  conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
end

function getSlotType(n)
  if not n then
  return false
  end
  if n:match('%[(.+)%]') then
  n = n:match('%[(.+)%]')
  if n == '?' then
  return 0,n
  else
  return n:match('(.-)%.([+-])(%d+)%%')
  end
  else
  return false
  end
end

local function loadSet(cid)
local player = Player(cid)
if not player then return false end
  local t = {}
  for slot=1,9 do
  t[slot] = ''
  local s = getPlayerSlotItem(player,slot).uid
  if s ~= 0 then
  t[slot] = Item(s):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
  end
  end
  return t
end

function chk(cid,f)
  if not Player(cid) then return false end
  local t = loadSet(cid)
  if not t then return false end
 
  for i=1,#f do
  if f[i] ~= t[i] then
  equip(player,nil,slot)
  break
  end
  end
  addEvent(chk,2000,cid,t)
end

function check_slot(aab, i)
  if i == 5 or i == 6 then
  if isWeapon(aab) or isShield(aab) or isBow(aab) then
  return true
  end
  else
  return true
  end
return false
end

function equip(player,item,slot)
  local t = {}
  if item then
  local mm,sinal,qto = getSlotType(Item(item.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION))
  t[mm] = tonumber(qto)
  end
  for i=1,9 do
  if i ~= slot then
  if getPlayerSlotItem(player,i).itemid ~= 0 then
  local aab = getPlayerSlotItem(player,i).uid
  if aab and check_slot(aab,i) then
  for _ in Item(aab):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gmatch('(%[.-%])') do
  local mm,sinal,qto2 = getSlotType(_)
  if mm then
  if not t[mm] then
  t[mm] = 0
  end
  t[mm] = t[mm]+tonumber(qto2)
  t[mm] = t[mm] > 300 and 300 or t[mm]
  end
  end
  end
  end
  end
  end
  local fu = 0
  local ca = {}
  local s = ''
  for sl,n in pairs(t) do
  fu = fu+1
  s = s..''..n..'% more of '..sl..'\n'
  if sl == 'hp' then
  player:addCondition(conditionHP[tonumber(n)])
  ca[50] = 1
  doSendTutorial(player,19)
  elseif sl == 'mp' then
  player:addCondition(conditionMP[tonumber(n)])
  ca[51] = 1
  doSendTutorial(player,19)
  elseif sl == 'ml' then
  player:addCondition(conditionML[tonumber(n)])
  ca[52] = 1
  elseif sl == 'melee' then
  player:addCondition(conditionCLUB[tonumber(n)])
  ca[53] = 1
  elseif sl == 'shield' then
  player:addCondition(conditionSHI[tonumber(n)])
  ca[54] = 1
  elseif sl == 'dist' then
  player:addCondition(conditionDIST[tonumber(n)])
  ca[55] = 1
  end
  end
  if fu > 0 then
  for i=50,55 do
  if not ca[i] then
  doRemoveCondition(player,CONDITION_ATTRIBUTES,i)
  end
  end
  else
  for i=50,55 do
  doRemoveCondition(player,CONDITION_ATTRIBUTES,i)
  end
  end
  return true
end

function onLogin(player)
  equip(player,nil,slot)
local cid = player:getId()
  addEvent(chk,2000,cid,loadSet(cid))
  return true
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Tenta :

 

local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,300 do
  conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50)
  setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+i)

  conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51)
  setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 100+i)

  conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52)
  setConditionParam(conditionML[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICPOINTSPERCENT, 100+i)


  conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_MELEEPERCENT, 100+i)


  conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)

  conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
end

function getSlotType(n)
  if not n then
  return false
  end
  if n:match('%[(.+)%]') then
  n = n:match('%[(.+)%]')
  if n == '?' then
  return 0,n
  else
  return n:match('(.-)%.([+-])(%d+)%%')
  end
  else
  return false
  end
end

local function loadSet(cid)
local player = Player(cid)
if not player then return false end
  local t = {}
  for slot=1,9 do
  t[slot] = ''
  local s = getPlayerSlotItem(player,slot).uid
  if s ~= 0 then
  t[slot] = Item(s):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
  end
  end
  return t
end

function chk(cid,f)
  if not Player(cid) then return false end
  local t = loadSet(cid)
  if not t then return false end
 
  for i=1,#f do
  if f[i] ~= t[i] then
  equip(player,nil,slot)
  break
  end
  end
  addEvent(chk,2000,cid,t)
end

function check_slot(aab, i)
  if i == 5 or i == 6 then
  if isWeapon(aab) or isShield(aab) or isBow(aab) then
  return true
  end
  else
  return true
  end
return false
end

function equip(player,item,slot)
  local t = {}
  if item then
  local mm,sinal,qto = getSlotType(Item(item.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION))
  t[mm] = tonumber(qto)
  end
  for i=1,9 do
  if i ~= slot then
  if getPlayerSlotItem(player,i).itemid ~= 0 then
  local aab = getPlayerSlotItem(player,i).uid
  if aab and check_slot(aab,i) then
  for _ in Item(aab):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gmatch('(%[.-%])') do
  local mm,sinal,qto2 = getSlotType(_)
  if mm then
  if not t[mm] then
  t[mm] = 0
  end
  t[mm] = t[mm]+tonumber(qto2)
  t[mm] = t[mm] > 300 and 300 or t[mm]
  end
  end
  end
  end
  end
  end
  local fu = 0
  local ca = {}
  local s = ''
  for sl,n in pairs(t) do
  fu = fu+1
  s = s..''..n..'% more of '..sl..'\n'
  if sl == 'hp' then
  player:addCondition(conditionHP[tonumber(n)])
  ca[50] = 1
  doSendTutorial(player,19)
  elseif sl == 'mp' then
  player:addCondition(conditionMP[tonumber(n)])
  ca[51] = 1
  doSendTutorial(player,19)
  elseif sl == 'ml' then
  player:addCondition(conditionML[tonumber(n)])
  ca[52] = 1
  elseif sl == 'melee' then
  player:addCondition(conditionCLUB[tonumber(n)])
  ca[53] = 1
  elseif sl == 'shield' then
  player:addCondition(conditionSHI[tonumber(n)])
  ca[54] = 1
  elseif sl == 'dist' then
  player:addCondition(conditionDIST[tonumber(n)])
  ca[55] = 1
  end
  end
  if fu > 0 then
  for i=50,55 do
  if not ca[i] then
  doRemoveCondition(player:getId(),CONDITION_ATTRIBUTES,i)
  end
  end
  else
  for i=50,55 do
  doRemoveCondition(player:getId(),CONDITION_ATTRIBUTES,i)
  end
  end
  return true
end

function onLogin(cid)
local player = Player(cid)
	equip(player, nil, slot)
  	addEvent(chk,2000,player,loadSet(player))
  	return true
end
  

Editado por Kawoszin
Link para o comentário
Compartilhar em outros sites

  • 0

Tente :

local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,300 do
  conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50)
  setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+i)

  conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51)
  setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 100+i)

  conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52)
  setConditionParam(conditionML[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICPOINTSPERCENT, 100+i)


  conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_MELEEPERCENT, 100+i)


  conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)

  conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF_SPELL, 1)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1)
  setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
end

function getSlotType(n)
  if not n then
  return false
  end
  if n:match('%[(.+)%]') then
  n = n:match('%[(.+)%]')
  if n == '?' then
  return 0,n
  else
  return n:match('(.-)%.([+-])(%d+)%%')
  end
  else
  return false
  end
end

local function loadSet(cid)
local player = Player(cid)
if not player then return false end
  local t = {}
  for slot=1,9 do
  t[slot] = ''
  local s = getPlayerSlotItem(player,slot).uid
  if s ~= 0 then
  t[slot] = Item(s):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
  end
  end
  return t
end

function chk(cid,f) 
local player = Player(cid)
    local t = loadSet(player)
    if not t then return false end   
    for i=1,#f do
        if f[i] ~= t[i] then
            equip(player,nil,slot)
            break
        end
    end
    addEvent(chk,2000,player,t)
end

function check_slot(aab, i)
  if i == 5 or i == 6 then
  if isWeapon(aab) or isShield(aab) or isBow(aab) then
  return true
  end
  else
  return true
  end
return false
end

function equip(cid,item,slot)
local player = Player(cid)
  local t = {}
  if item then
  local mm,sinal,qto = getSlotType(Item(item.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION))
  t[mm] = tonumber(qto)
  end
  for i=1,9 do
  if i ~= slot then
  if getPlayerSlotItem(player,i).itemid ~= 0 then
  local aab = getPlayerSlotItem(player,i).uid
  if aab and check_slot(aab,i) then
  for _ in Item(aab):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gmatch('(%[.-%])') do
  local mm,sinal,qto2 = getSlotType(_)
  if mm then
  if not t[mm] then
  t[mm] = 0
  end
  t[mm] = t[mm]+tonumber(qto2)
  t[mm] = t[mm] > 300 and 300 or t[mm]
  end
  end
  end
  end
  end
  end
  local fu = 0
  local ca = {}
  local s = ''
  for sl,n in pairs(t) do
  fu = fu+1
  s = s..''..n..'% more of '..sl..'\n'
  if sl == 'hp' then
  player:addCondition(conditionHP[tonumber(n)])
  ca[50] = 1
  doSendTutorial(player,19)
  elseif sl == 'mp' then
  player:addCondition(conditionMP[tonumber(n)])
  ca[51] = 1
  doSendTutorial(player,19)
  elseif sl == 'ml' then
  player:addCondition(conditionML[tonumber(n)])
  ca[52] = 1
  elseif sl == 'melee' then
  player:addCondition(conditionCLUB[tonumber(n)])
  ca[53] = 1
  elseif sl == 'shield' then
  player:addCondition(conditionSHI[tonumber(n)])
  ca[54] = 1
  elseif sl == 'dist' then
  player:addCondition(conditionDIST[tonumber(n)])
  ca[55] = 1
  end
  end
  if fu > 0 then
  for i=50,55 do
  if not ca[i] then
  doRemoveCondition(player,CONDITION_ATTRIBUTES,i)
  end
  end
  else
  for i=50,55 do
  doRemoveCondition(player,CONDITION_ATTRIBUTES,i)
  end
  end
  return true
end

function onLogin(cid)
local player = Player(cid)
    equip(player, nil, slot)
    addEvent(chk,2000,player,loadSet(player))
    return true
end
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...