Poste seu script.
6
4.1k
info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

29 de setembro de 2015 às 00:45
info
Grupo: Cavaleiro
Registrado: 17/06/15
Posts: 177
Reputação: +9
Char no Tibia: GOD Server

29 de setembro de 2015 às 00:53
Poste seu script.
function string.diff(self)
local format = {
{'day', self / 60 / 60 / 24},
{'hour', self / 60 / 60 % 24},
{'minute', self / 60 % 60},
{'second', self % 60}
}
local out = {}
for k, t in ipairs(format) do
local v = math.floor(t[2])
if(v > 0) then
table.insert(out, (k < #format and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
end
end
local ret = table.concat(out)
if ret:len() < 16 and ret:find('second') then
local a, b = ret:find(' and ')
ret = ret:sub(b+1)
end
return ret
end
local config = {
exhaustion = 299551, -- exhaust storage
duration = 5 -- CONTADO EM SEGUNDOS, POR EXEMPLO 5*60 PARA 5 MINUTOS.
}
function onSay(player, words, param, channel, creature)
local playerGuild = player:getGuild()
local creature = player
if (os.time() - player:getStorageValue(config.exhaustion)) < config.duration then
player:sendTextMessage(MESSAGE_INFO_DESCR,"You have to wait ' .. string.diff(player:getStorageValue(config.exhaustion)-os.time()) .. ' before using this command again.")
return false
end
if(not playerGuild or playerGuild:getId() == 0) then
player:sendTextMessage(MESSAGE_INFO_DESCR,"Sorry, you're not in a guild.")
return false
end
if player:getGuildLevel() < 2 then -- 3 = Leader, 2 = Vice-Leader, 1 = Regular Member
player:sendTextMessage(MESSAGE_INFO_DESCR,"You have to be Leader or Vice-Leader of your guild to change outfits!")
return false
end
local outfit = creature:getOutfit()
local count = 0
local message = "*Guild* Your outfit has been changed by leader. (" ..player:getName() .. ")"
for _, members in ipairs(Game.getPlayers()) do
if(members:getGuild() == playerGuild and player ~= members) then
local newOutfit = outfit
if(not members:hasOutfit(outfit.lookType, outfit.lookAddons)) then
local tmpOutfit = members:getOutfit()
newOutfit.lookAddons = 0 --tmpOutfit.lookAddons
if(not members:hasOutfit(outfit.lookType, 0)) then
newOutfit.lookType = tmpOutfit.lookType
end
end
members:getPosition():sendMagicEffect(66)
members:setOutfit(newOutfit)
members:sendTextMessage(MESSAGE_INFO_DESCR, message)
count = count + 1
end
end
player:sendTextMessage(MESSAGE_INFO_DESCR,"Guild members outfit has been changed. (Total: " .. count .. ")")
player:setStorageValue(config.exhaustion, os.time() + config.duration)
return false
end
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

29 de setembro de 2015 às 01:11
Melhor resposta
Tenta esse aqui:
local config = {
exhaustionInSeconds = 10,
storage = 34534
}
function onSay(cid, words, param)
if(exhaustion.check(cid, config.storage) == TRUE) then
doPlayerSendCancel(cid, "É necessário esperar mais " .. config.exhaustionInSeconds .. " segundos para fazer a troca novamente.")
return TRUE
end
local playerGuild = getPlayerGuildId(cid)
if(playerGuild == FALSE) then
doPlayerSendCancel(cid, "Desculpe, você não pertence a nenhuma Guild.")
return TRUE
end
local playerGuildLevel = getPlayerGuildLevel(cid)
if(playerGuildLevel < GUILDLEVEL_VICE) then
doPlayerSendCancel(cid, "Você precisa ser líder de uma Guild para mudar os outfits.")
return TRUE
end
local players = getPlayersOnline()
local outfit = getCreatureOutfit(cid)
local message = "*Guild* Seu outfit foi mudado pelo líder da sua guild. (" .. getCreatureName(cid) .. ")"
local members = 0
local tmp = {}
for i, tid in ipairs(players) do
if(getPlayerGuildId(tid) == playerGuild and cid ~= tid) then
tmp = outfit
if(canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons) ~= TRUE) then
local tidOutfit = getCreatureOutfit(tid)
tmp.lookType = tidOutfit.lookType
tmp.lookAddons = tidOutfit.lookAddons
end
doSendMagicEffect(getCreaturePosition(tid), 66)
doCreatureChangeOutfit(tid, tmp)
doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
members = members + 1
end
end
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doPlayerSendCancel(cid, "As roupas dos Membros da Guild foram trocadas. (Total: " .. members .. ")")
return TRUE
end
info
Grupo: Cavaleiro
Registrado: 17/06/15
Posts: 177
Reputação: +9
Char no Tibia: GOD Server

29 de setembro de 2015 às 01:24
Tenta esse aqui:
local config = { exhaustionInSeconds = 10, storage = 34534 } function onSay(cid, words, param) if(exhaustion.check(cid, config.storage) == TRUE) then doPlayerSendCancel(cid, "É necessário esperar mais " .. config.exhaustionInSeconds .. " segundos para fazer a troca novamente.") return TRUE end local playerGuild = getPlayerGuildId(cid) if(playerGuild == FALSE) then doPlayerSendCancel(cid, "Desculpe, você não pertence a nenhuma Guild.") return TRUE end local playerGuildLevel = getPlayerGuildLevel(cid) if(playerGuildLevel < GUILDLEVEL_VICE) then doPlayerSendCancel(cid, "Você precisa ser líder de uma Guild para mudar os outfits.") return TRUE end local players = getPlayersOnline() local outfit = getCreatureOutfit(cid) local message = "*Guild* Seu outfit foi mudado pelo líder da sua guild. (" .. getCreatureName(cid) .. ")" local members = 0 local tmp = {} for i, tid in ipairs(players) do if(getPlayerGuildId(tid) == playerGuild and cid ~= tid) then tmp = outfit if(canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons) ~= TRUE) then local tidOutfit = getCreatureOutfit(tid) tmp.lookType = tidOutfit.lookType tmp.lookAddons = tidOutfit.lookAddons end doSendMagicEffect(getCreaturePosition(tid), 66) doCreatureChangeOutfit(tid, tmp) doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message) members = members + 1 end end exhaustion.set(cid, config.storage, config.exhaustionInSeconds) doPlayerSendCancel(cid, "As roupas dos Membros da Guild foram trocadas. (Total: " .. members .. ")") return TRUE end
Foi Parça
VLlww



info
Grupo: Cavaleiro
Registrado: 17/06/15
Posts: 177
Reputação: +9
Char no Tibia: GOD Server
Eai galera blz ?
Bem pedido que venho fase aki
Se alguem pudesse me ajudar
E de comando !roupa de guild
Porem eu queria que
so mude a cor da roupa e
Nao mude a montaria do player e nem o addon
O script que eu tenho ao lider dar
roupa todos ficao com mesmo look dele
Incluindo o addon e mont isso e foda
Todos player acabao ficando com montarias esclusivas
Se alguem puder me ajudar ai
Repp++
Obrigado
Versao : 10.10