Ativar script depois de 5 segundos

GniusP
Por GniusP
em Scripts

GniusP

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 20/04/18Posts: 116

Pessoal, tenho uma script que o player ganha x item e volta para o cp quando não tem ninguem em x  area, mas eu gostaria de fazer com que essa script fosse ativada depois de 5 segundos após o player pisar nesse tile.

Exemplo: Player pisa no tile, da 5 segundos e o script é ativado

Se não tiver ninguem nessa area, o script passa 5 segundos e funciona normal, caso tenha player nessa area, o script não funciona!

A script ja esta ok, só falta adicionar 5 segundos

 

function onStepIn(cid, item, position, fromPosition)
local pos = {x = 1037, y = 1034, z = 7}
local battlewin = 1
if #getCreatureSummons(cid) >= 1 then
else
if #getPlayersInArea(battleroyale.area) > 1 then return true end
doTeleportThing(cid, pos)
local item = doPlayerAddItem(cid, 5805, 1)
doItemSetAttribute(item, "description", getCreatureName(cid).." conquistou este trofeu apos vencer uma partida no Battle Royale.")
doBroadcastMessage(""..getCreatureName(cid).." Venceu o evento Battle Royale")
doPlayerAddItem(cid,12618,1)
doPlayerAddItem(cid,2152,30)
addTopbattle(cid, battlewin)
return true
end
end

 

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino
function onStepIn(cid, item, position, fromPosition)
local pos = {x = 1037, y = 1034, z = 7}
local battlewin = 1
if #getCreatureSummons(cid) >= 1 then
return true
end

addEvent(function()

if #getPlayersInArea(battleroyale.area) > 1 then 
doTeleportThing(cid, pos)
local item = doPlayerAddItem(cid, 5805, 1)
doItemSetAttribute(item, "description", getCreatureName(cid).." conquistou este trofeu apos vencer uma partida no Battle Royale.")
doBroadcastMessage(""..getCreatureName(cid).." Venceu o evento Battle Royale")
doPlayerAddItem(cid,12618,1)
doPlayerAddItem(cid,2152,30)
addTopbattle(cid, battlewin)
else
doPlaerSendCancel(cid, "Not Win")
end

end,5*10000)
return true
end

 

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end