Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Isso tem correção? Se não tiver, eu vou remover do servidor.

 

Acontece quando deslogo e logo com o item equipado no slot de ring

<movevent type="Equip" itemid="2363" slot="ring" event="script" value="brilhabrilha.lua"/>
<movevent type="DeEquip" itemid="2363" slot="ring" event="script" value="brilhabrilha.lua"/>

 

local colors = {94, 81, 79, 88, 18, 11, 92, 128}
local storage = 65539
local time = 1 --in miliseconds

function onEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) < 1 then
        local event = addEvent(changeOutfit, time, cid)
        setPlayerStorageValue(cid, storage, 1)
    return true
    end
return true
end

function onDeEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) > 0 then
        setPlayerStorageValue(cid, storage, 0)
    return true
    end
return true
end

function changeOutfit(cid)
local randomHead = colors[math.random(#colors)]
local randomLegs = colors[math.random(#colors)]
local randomBody = colors[math.random(#colors)]
local randomFeet = colors[math.random(#colors)]
local tmp = {}
 
    if getPlayerStorageValue(cid, storage) > 0 then
        local outfit = getCreatureOutfit(cid)
        tmp = outfit
        tmp.lookType = outfit.lookType
        tmp.lookHead = randomHead
        tmp.lookLegs = randomLegs
        tmp.lookBody = randomBody
        tmp.lookFeet = randomFeet
        tmp.lookAddons = outfit.lookAddons 
        doCreatureChangeOutfit(cid, tmp)
        local event = addEvent(repeatChangeOutfit, time, cid)
        return TRUE
    else
    stopEvent(event)
    return TRUE
    end
end
 
function repeatChangeOutfit(cid)
 
local randomHead = colors[math.random(#colors)]
local randomLegs = colors[math.random(#colors)]
local randomBody = colors[math.random(#colors)]
local randomFeet = colors[math.random(#colors)]
local tmp = {}
 
    if getPlayerStorageValue(cid, storage) > 0 then
        local outfit = getCreatureOutfit(cid)
        tmp = outfit
        tmp.lookType = outfit.lookType
        tmp.lookHead = randomHead
        tmp.lookLegs = randomLegs
        tmp.lookBody = randomBody
        tmp.lookFeet = randomFeet
        tmp.lookAddons = outfit.lookAddons 
        doCreatureChangeOutfit(cid, tmp)
        local event = addEvent(changeOutfit, time, cid)
        return TRUE
    else
        stopEvent(event)
        return TRUE
    end
end

 

 

Sem título.png

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Resolvido por KotZletY

Ir para solução
Postado
  • Solução

@jNo

Spoiler

local colors = {94, 81, 79, 88, 18, 11, 92, 128}
local storage = 65539
local time = 1 --in miliseconds

function onEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) < 1 then
        local event = addEvent(changeOutfit, time, cid)
        setPlayerStorageValue(cid, storage, 1)
    return true
    end
return true
end

function onDeEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) > 0 then
        setPlayerStorageValue(cid, storage, 0)
    return true
    end
return true
end

function changeOutfit(cid)
local randomHead = colors[math.random(#colors)]
local randomLegs = colors[math.random(#colors)]
local randomBody = colors[math.random(#colors)]
local randomFeet = colors[math.random(#colors)]
local tmp = {}
  if isPlayer(cid) then
    if getPlayerStorageValue(cid, storage) > 0 then
        local outfit = getCreatureOutfit(cid)
        tmp = outfit
        tmp.lookType = outfit.lookType
        tmp.lookHead = randomHead
        tmp.lookLegs = randomLegs
        tmp.lookBody = randomBody
        tmp.lookFeet = randomFeet
        tmp.lookAddons = outfit.lookAddons 
        doCreatureChangeOutfit(cid, tmp)
        local event = addEvent(repeatChangeOutfit, time, cid)
        return TRUE
    else
    stopEvent(event)
    return TRUE
    end
  end	
end
 
function repeatChangeOutfit(cid)
 
local randomHead = colors[math.random(#colors)]
local randomLegs = colors[math.random(#colors)]
local randomBody = colors[math.random(#colors)]
local randomFeet = colors[math.random(#colors)]
local tmp = {}
 if isPlayer(cid) then
    if getPlayerStorageValue(cid, storage) > 0 then
        local outfit = getCreatureOutfit(cid)
        tmp = outfit
        tmp.lookType = outfit.lookType
        tmp.lookHead = randomHead
        tmp.lookLegs = randomLegs
        tmp.lookBody = randomBody
        tmp.lookFeet = randomFeet
        tmp.lookAddons = outfit.lookAddons 
        doCreatureChangeOutfit(cid, tmp)
        local event = addEvent(changeOutfit, time, cid)
        return TRUE
    else
        stopEvent(event)
        return TRUE
    end
 end	
end



 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Postado
  • Autor
6 horas atrás, KotZletY disse:

@jNo

  Mostrar conteúdo oculto


local colors = {94, 81, 79, 88, 18, 11, 92, 128}
local storage = 65539
local time = 1 --in miliseconds

function onEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) < 1 then
        local event = addEvent(changeOutfit, time, cid)
        setPlayerStorageValue(cid, storage, 1)
    return true
    end
return true
end

function onDeEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) > 0 then
        setPlayerStorageValue(cid, storage, 0)
    return true
    end
return true
end

function changeOutfit(cid)
local randomHead = colors[math.random(#colors)]
local randomLegs = colors[math.random(#colors)]
local randomBody = colors[math.random(#colors)]
local randomFeet = colors[math.random(#colors)]
local tmp = {}
  if isPlayer(cid) then
    if getPlayerStorageValue(cid, storage) > 0 then
        local outfit = getCreatureOutfit(cid)
        tmp = outfit
        tmp.lookType = outfit.lookType
        tmp.lookHead = randomHead
        tmp.lookLegs = randomLegs
        tmp.lookBody = randomBody
        tmp.lookFeet = randomFeet
        tmp.lookAddons = outfit.lookAddons 
        doCreatureChangeOutfit(cid, tmp)
        local event = addEvent(repeatChangeOutfit, time, cid)
        return TRUE
    else
    stopEvent(event)
    return TRUE
    end
  end	
end
 
function repeatChangeOutfit(cid)
 
local randomHead = colors[math.random(#colors)]
local randomLegs = colors[math.random(#colors)]
local randomBody = colors[math.random(#colors)]
local randomFeet = colors[math.random(#colors)]
local tmp = {}
 if isPlayer(cid) then
    if getPlayerStorageValue(cid, storage) > 0 then
        local outfit = getCreatureOutfit(cid)
        tmp = outfit
        tmp.lookType = outfit.lookType
        tmp.lookHead = randomHead
        tmp.lookLegs = randomLegs
        tmp.lookBody = randomBody
        tmp.lookFeet = randomFeet
        tmp.lookAddons = outfit.lookAddons 
        doCreatureChangeOutfit(cid, tmp)
        local event = addEvent(changeOutfit, time, cid)
        return TRUE
    else
        stopEvent(event)
        return TRUE
    end
 end	
end



 

 

 

Quando reloga, não troca mais a roupa, mas não da o erro que é mais importante, o player que se vire e coloque de novo o ring, vlw!

obrigado

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

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.6k

Informação Importante

Confirmação de Termo