Testa assim:
events2[getPlayerGUID(cid)] = addEvent(doRemoveCreature, config.tempo*60*1000-500, cid)
info
Grupo: Cavaleiro
Registrado: 10/03/13
Posts: 177
Reputação: +202
Gênero: Masculino
Char no Tibia: stor akia

Testa assim:
events2[getPlayerGUID(cid)] = addEvent(doRemoveCreature, config.tempo*60*1000-500, cid)
info
Grupo: Visconde
Registrado: 24/11/12
Posts: 474
Reputação: +98
Gênero: Masculino

6 minutos atrás, luis700 disse:Testa assim:
events2[getPlayerGUID(cid)] = addEvent(doRemoveCreature, config.tempo*60*1000-500, cid)
[21:11:24.849] [Error - LuaInterface::loadFile] data/movements/scripts/autokick.lua:8: '=' expected near '?'
[21:11:24.850] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/autokick.lua)
[21:11:24.851] data/movements/scripts/autokick.lua:8: '=' expected near '?'
info
Grupo: Cavaleiro
Registrado: 10/03/13
Posts: 177
Reputação: +202
Gênero: Masculino
Char no Tibia: stor akia

Teste ai mano, acabei de testar aqui e está funcionando normal.
local events1, events2= {}, {} local config = { tempo = 2, storage = 22220 } function onStepIn(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSendTextMessage(cid, 22, "Você tem 2 minutos.") setPlayerStorageValue(cid, config.storage, 1) events1[getPlayerGUID(cid)] = addEvent(setPlayerStorageValue, config.tempo*60*1000-1000, cid, config.storage, -1) events2[getPlayerGUID(cid)] = addEvent(doRemoveCreature, config.tempo*60*1000-500, cid) end return true end function onStepOut(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) >= 1 then setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, 23, "System kick off!") stopEvent(events1[getPlayerGUID(cid)]) stopEvent(events2[getPlayerGUID(cid)]) end return true end
OBS: Escreva o código em vez de copiar e colar, acabei de fazer um teste e me parece que copiando e colando daqui, no código buga, esse foi o motivo de dar erro no seu, a logica é esta se não fazer o que falei, não vai conseguir mesmo executar o script.
Editado Dezembro 5 por luis700
info
Grupo: Visconde
Registrado: 24/11/12
Posts: 474
Reputação: +98
Gênero: Masculino

7 horas atrás, luis700 disse:Teste ai mano, acabei de testar aqui e está funcionando normal.
local events1, events2= {}, {} local config = { tempo = 2, storage = 22220 } function onStepIn(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSendTextMessage(cid, 22, "Você tem 2 minutos.") setPlayerStorageValue(cid, config.storage, 1) events1[getPlayerGUID(cid)] = addEvent(setPlayerStorageValue, config.tempo*60*1000-1000, cid, config.storage, -1) events2[getPlayerGUID(cid)] = addEvent(doRemoveCreature, config.tempo*60*1000-500, cid) end return true end function onStepOut(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) >= 1 then setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, 23, "System kick off!") stopEvent(events1[getPlayerGUID(cid)]) stopEvent(events2[getPlayerGUID(cid)]) end return true end
OBS: Escreva o código em vez de copiar e colar, acabei de fazer um teste e me parece que copiando e colando daqui, no código buga, esse foi o motivo de dar erro no seu, a logica é esta se não fazer o que falei, não vai conseguir mesmo executar o script.
Sim, estava ciente disso. Consegui arrumar antss de você responder novamente, mas obrigado por tentar ajudar! reputado
info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino

info
Grupo: Visconde
Registrado: 24/11/12
Posts: 474
Reputação: +98
Gênero: Masculino
Galera, eu queria a ajuda de vocês pra editar esse script. Ele funciona da seguinte forma: se o player ficar ausente sem se mexer etc por X minutos ele é levado ao templo>
Gostaria que ao inves de ser levado ao templo, ele deslogasse. no caso, fosse kikado.
Segue os codigos:
events1,events2= {},{} local config = {tempo = 2,storage = 22220 } function onStepIn(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSendTextMessage(cid, 22, "Você tem 2 minutos.") setPlayerStorageValue(cid, config.storage, 1) events1[getPlayerGUID(cid)] = addEvent(setPlayerStorageValue, config.tempo*60*1000-1000, cid, config.storage, -1) events2[getPlayerGUID(cid)] = addEvent(doTeleportThing, config.tempo*60*1000-500, cid, getTownTemplePosition(getPlayerTown(cid))) end return true end function onStepOut(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) >= 1 then setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, 23, "System kick off!") stopEvent(events1[getPlayerGUID(cid)]) stopEvent(events2[getPlayerGUID(cid)]) end return true end