Ir para conteúdo

Featured Replies

Postado

Comando

!color

/color

Você usa o comando e a cor do seu outfit muda de forma aleatória.

 

Instalando

randomcolor.lua

local config = {
needPremium = true, -- Precisa de premium?
needMoney = 25000, -- Precisa de premium? Se precisar, coloque o dinheiro necessário, se não precisar, coloque "false".
makeExhaustion = 5, ---  Quer deixar com exhaust? Coloque o tempo de exhaust em segundos, se não quiser, coloque "false".
exhaustionStorage = 3232, ------ storage para salvar o exhausted.
effect = CONST_ME_BLOCKHIT, -- Irá aparecer algum efeito? Se sim, coloque o número do efeito, coloque "false" se não.
msg = "MUDANDO DE COR DE OUTFIT....", -- Mensagem que irá aparecer
type = MESSAGE_INFO_DESCR, - O tipo de mensagem que será enviada, aqui estão tipos de mensagem:

--[[MESSAGE_EVENT_ADVANCE,
MESSAGE_EVENT_DEFAULT,
MESSAGE_STATUS_CONSOLE_ORANGE,
MESSAGE_INFO_DESCR,
MESSAGE_STATUS_SMALL,
MESSAGE_STATUS_CONSOLE_BLUE,
MESSAGE_STATUS_CONSOLE_RED,
MESSAGE_STATUS_WARNING, 
you can see it too in lib/constant.lua  ]] -- 
}

function onSay(cid, words, param, channel)

if (exhaustion.get (cid, config.exhaustionStorage)) then
return doPlayerSendCancel (cid, "Wait "..exhaustion.get (cid, config.exhaustionStorage).. " seconds to do it again.")
end
if (config.needPremium and isPremium (cid) == false) then
return doPlayerSendCancel(cid, "You need premium to use this command.")
end

if (config.needMoney ~= false and tonumber(config.needMoney) and doPlayerRemoveMoney(cid, config.needMoney) == false ) then
return doPlayerSendCancel (cid, "You need "..config.needMoney.. " to use this command.")
end

if (config.makeExhaustion ~= false and tonumber(config.makeExhaustion)) then
exhaustion.set (cid, config.exhaustionStorage, config.makeExhaustion)
end

if (config.effect ~= false and tonumber(config.effect)) then
local pos = getThingPos(cid)
doSendMagicEffect(pos, config.effect)
end

if (config.msg ~= false) then
doPlayerSendTextMessage(cid, config.type, config.msg)
end

local out = getCreatureOutfit(cid)
doCreatureChangeOutfit (cid, {lookType = out.lookType, lookHead = math.random(132) , lookBody = math.random(132), lookLegs = math.random(132), lookFeet = math.random(132), lookAddons = out.lookAddons } ) 
return true
end

talkactions.xml

<talkaction words="!color;/color" event="script" value="randomcolor.lua" />

Observação

Caso queira que o player logue e logo mude a cor do outfit automaticamente, coloque isso em login:

local out = getCreatureOutfit(cid)
doCreatureChangeOutfit (cid, {lookType = out.lookType, lookHead = math.random(132) , lookBody = math.random(132), lookLegs = math.random(132), lookFeet = math.random(132), lookAddons = out.lookAddons } )

Créditos

  • StreamSide, Jetro

Editado por Larissa Azhaurn (veja o histórico de edições)

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