OTHispano
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

Ir abajo
[Talkaction] New Rainbow System! 9uylN
"Ryukend"
Miembro
Mensajes Mensajes : 120

[Talkaction] New Rainbow System! Empty [Talkaction] New Rainbow System!

Mar Nov 08, 2011 1:10 pm
Aqui un video de su funcionamiento:



Ahora vamos a data\lib\050-function.lua y añadimos esto:
Código:

czekaj = coroutine.yield
function czekanie(c)
    if(coroutine.status(c) ~= 'dead') then
        local _, czas = coroutine.resume(c)
        addEvent(czekanie, czas, c)
    end
end
function zacznijCzekac(f)
    if(type(f) == 'function') then
        local c = coroutine.create(f)
        czekanie(c)
    end
end
function timeString(timeDiff)
    local dateFormat = {
        {"day", timeDiff / 60 / 60 / 24},
        {"hour", timeDiff / 60 / 60 % 24},
        {"minute", timeDiff / 60 % 60},
        {"second", timeDiff % 60}
    }
    local out = {}
    for k, t in ipairs(dateFormat) do
        local v = math.floor(t[2])
        if(v > 0) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        end
    end
    return table.concat(out)
end

Bien ahora vamos a data\talkactions\scripts\rainbowsys.lua , asi llamamos al script, y pegamos esto dentro:

Código:

function onSay(cid, words, param)
--config ## Script By Dubler from otland.net ##
local t = 5 -- time in seconds
local fr = 4 -- frequency, changes per second
--endconfig ## Script By Dubler from otland.net ##
local frequency = (1000 / fr)
local timevar = (fr * t)
 zacznijCzekac(function()
  for i = 1, timevar do
      cc(cid)
      czekaj(frequency)
      local i = (i + 1)
  end
end)
return true
end
function cc(cid)
local head = math.random(133)
local body = math.random(133)
local legs = math.random(133)
local feet = math.random(133)
local myOutfit = getCreatureOutfit(cid)
local outfit = {lookType = myOutfit.lookType, lookHead = head, lookAddons = myOutfit.lookAddons, lookLegs = legs, lookBody = body, lookFeet = feet}
doSetCreatureOutfit(cid, outfit, (frequency +5))
end

Ahora por ultimo vamos a data\talkactions\talkactions.xml y añadimos esto:
Código:

<talkaction words="/rainbow" event="script" value="rainbowsys.lua"/>

Creditos para OtLand
Volver arriba
Permisos de este foro:
No puedes responder a temas en este foro.