Ir para conteúdo

Featured Replies

Postado

Alguém poderia passa esse script de clean em determinada posição para talkaction aki ele esta como globalevent.

local created_by_otswe = true -- Do not edit, if you touch this line the script will not work propely

local otswe = {
Clean_Time = 1, -- When the warning text has been broadcast, for how many seconds should it take to execute the clean
Warning_Text_Before_Clean = "", -- Here can you edit the warning text 
Done_Text = "" -- Here you can edit the done text
}

local OtsweCleaningAreaPositions = {
from = {x=1122,y=593,z=7}, -- From top left -- Top left of the cleaning area
to = {x=1135,y=602,z=7} -- to bottom right -- Bottom left of the cleaning area
}

function isCleanAbleArea(pos)
pos.stackpos = 0
local tile = getThingfromPos(pos, false)
if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then
return true
end
end

function executeOtsweAreaClean()
doBroadcastMessage(otswe.Done_Text)
for x = OtsweCleaningAreaPositions.from.x, OtsweCleaningAreaPositions.to.x do
for y = OtsweCleaningAreaPositions.from.y, OtsweCleaningAreaPositions.to.y do
local p = {x=x,y=y,z=OtsweCleaningAreaPositions.from.z}
if isCleanAbleArea(p) or created_by_otswe == true then 
doCleanTile(p,false)
end
end
end
end

function onThink(cid, interval, lastExecution)
addEvent(executeOtsweAreaClean, otswe.Clean_Time*1000)
doBroadcastMessage(otswe.Warning_Text_Before_Clean)
return true
end

Resolvido por xWhiteWolf

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

troca function onThink(cid, interval, lastExecution) pelo callback da talkaction, e depois troca o script de pasta e adiciona no talkactions.xml. 

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

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