Ir para conteúdo

FALA TIME, ESSE SCRIPT ELE NÃO DÁ NENHUM ERRO NO CONSOLE, POIS NÃO LIBERA A ACTION DESCRITA

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

 

Qual o motivo deste tópico? 

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

NÃO

 

Você tem o código disponível? Se tiver publique-o aqui: 

function onUse(cid, item, fromPosition, itemEx, toPosition)
  local config =
  {
  minLevel = 200, -- Level mínimo para adquirir a gema.
  gems = 2154, 2155, 2156, 2158, -- id gemas
  storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008},
  interval = {600, 600, 600, 600, 600, 600, 600}, -- Intervalo dos efeitos
  efeito = {"' .    ,", ".    ' ,", "`  .  ,", ",    ' ."},
  colorDruid = {182,213},
  colorSorcerer = {215,215},
  colorPaladin = {89,89},
  colorKnight = {210,210},
  colorMajesticDruid = {182,213},
  colorSupremeSorcerer = {215,215},
  colorLordPaladin = {89,89},
  colorMonsterKnight = {210,210}
  }
local vocations = {
-- Vocation id 1 gonna upgrade to vocation id 2
-- Easy, huh?
[5] = 9,
[6] = 10,
[7] = 11,
[8] = 12,
}
 
local player = Player(cid)
if getPlayerLevel(cid) >= config.minLevel then
local vocation = player:getVocation()
local vocID = vocation:getId()
local vocationName = vocation:getName()
if vocation[vocID] then
  player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You have succesfully upgraded from a '..vocationName..' to a '..Vocation(vocations[vocID]):getName()..'. ')
  player:getPosition():sendMagicEffect(28)
  player:setVocation(Vocation(vocations[vocID]))
  Item(gems.uid😞remove()
else
 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce ja adquiriu sua gema espiritual.")
doSendMagicEffect(getCreaturePosition(cid), 3)
end
else
doPlayerSendCancel(cid, "Voce precisa ser level "..config.minLevel.." para adquirir a gema espiritual.")
end
return TRUE
end
function doUseGems(cid, item)
local vocation = player:getVocation()
local interval = gems.interval[vocID]
 
if gems.itemid ~= gems.id[vocID] or getPlayerStorageValue(cid, gems.storage[vocID]) > 0 then
  return FALSE
end
 
setPlayerStorageValue(cid, config.storage[voc], 1)
sendMagicEffect(cid, config.storage[voc], gems.interval[voc])
doRemoveItem(item.uid, 1)


 
return TRUE  
end
 
function sendGemEffect(cid, storage, interval)
local pos = getThingPos(cid)
local vocation = player:getVocation()
local color = 1
if voc == 5 then
color = efeito.colorDruid[math.random(1,#efeito.colorDruid)]
elseif voc == 6 then
color = efeito.colorSorcerer[math.random(1,#efeito.colorSorcerer)]
elseif voc == 7 then
color = efeito.colorPaladin[math.random(1,#efeito.colorPaladin)]
elseif voc == 8 then
color = efeito.colorKnight[math.random(1,#efeito.colorKnight)]
elseif voc == 9 then
color = efeito.colorDruid[math.random(1,#efeito.colorMajesticDruid)]
elseif voc == 10 then
color = efeito.colorSorcerer[math.random(1,#efeito.colorSupremeSorcerer)]
elseif voc == 11 then
color = efeito.colorPaladin[math.random(1,#efeito.colorLordPaladin)]
elseif voc == 12 then
color = efeito.colorKnight[math.random(1,#efeito.colorMonsterKnight)]
end
 
doSendAnimatedText(pos, config.efeito[math.random(1,#gemMsg.efeito)], color)
if getPlayerStorageValue(cid, config.storage[getPlayerVocation(cid)]) >= 1 then
  addEvent(sendMagicEffect, interval, cid, storage, interval)
end
end
 
function doRemoveMagicEffect(cid)
if getPlayerStorageValue(cid, config.storage[getPlayerVocation(cid)]) < 1 then
  return FALSE
end
setPlayerStorageValue(cid, config.storage[getPlayerVocation(cid)], 0)
return TRUE
end
 
function doRemoveAllGemEffect(cid)
for i = 1, table.maxn(config.storage) do
  setPlayerStorageValue(cid, config.storage[i], 0)
end
return TRUE
end
 
function isGemActivated(cid)
if getPlayerStorageValue(cid, config.storage[getPlayerVocation(cid)]) > 0 then
  return TRUE
end
return FALSE
end











 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo