talkactions.xml:
<talkaction words="!rainbow" event="script" value="rainbow.lua"/>
rainbow.lua:
local default_time = 300 -- time in seconds
local fr = 10 -- frequency, changes per second
local access_to_change_time = 3 -- access needed to set own time
-- end of config
local frequency = 1000 / fr
local rainbowEvents = {}
function rainbowOutfit(cid, count)
if(isPlayer(cid)) then
local newOutfit = getCreatureOutfit(cid)
newOutfit.lookHead = math.random(133)
newOutfit.lookBody = math.random(133)
newOutfit.lookLegs = math.random(133)
newOutfit.lookFeet = math.random(133)
doSetCreatureOutfit(cid, newOutfit, frequency + 5)
if(count >= 1) then
rainbowEvents[getPlayerGUID(cid)] = addEvent(rainbowOutfit, frequency, cid, count - 1)
end
end
end
function onSay(cid, words, param)
if(rainbowEvents[getPlayerGUID(cid)] ~= nil) then
doSendAnimatedText(getPlayerPosition(cid),"RAINBOW!", math.random(01,255))
stopEvent(rainbowEvents[getPlayerGUID(cid)])
end
if(param ~= '' and getPlayerAccess(cid) >= access_to_change_time) then
rainbowOutfit(cid, tonumber(param) * fr)
else
rainbowOutfit(cid, default_time * fr)
end
return true
end
Vê ai.
PS: Autor desconhecido.






info
Grupo: Artesão
Registrado: 19/05/11
Posts: 109
Reputação: +4
NÃO SEI SE VOCÊS JA VIRAM MAIS ESTÁ AI:
O VÍDEO MOSTRA LOGO NO INICIO UM PLAYER QUE FICA TROCANDO OS OUTFITES.
TERIA COMO FAZER ESSE SCRIPT PRA MIN?