Postado Abril 15, 2016 9 anos Olá galera!! Editei um script aqui da seguinte maneira Quando um player passa pelo tile aparece um brodcast para todos os players, mais estou com dificucade de colocar um tempo para o player passar no tile. (Não faço a menor ideia de como adicionar tempo em scripts) function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return true end end function onStepIn(cid, item, position, fromPosition) local STORAGE_GUILD_WIN = GRANTOWER.SAVELASTWINNER, if isPlayerGuild(cid) == true then if getPlayerGuildId(cid) ~= getGlobalStorageValue(STORAGE_GUILD_WIN) then doBroadcastMessage("O(a) Jogador "..getCreatureName(cid).." esta tentando invadir o castle da guild \""..getPlayerGuildName(cid) ..".", MESSAGE_STATUS_CONSOLE_BLUE) else doPlayerSendCancel(cid,"Avance") end else doPlayerSendCancel(cid,"Avance") end return true end
Postado Abril 15, 2016 9 anos Em 15/04/2016 em 18:45, Bagon disse: Olá galera!! Editei um script aqui da seguinte maneira Quando um player passa pelo tile aparece um brodcast para todos os players, mais estou com dificucade de colocar um tempo para o player passar no tile. (Não faço a menor ideia de como adicionar tempo em scripts) function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return true end end function onStepIn(cid, item, position, fromPosition) local STORAGE_GUILD_WIN = GRANTOWER.SAVELASTWINNER, if isPlayerGuild(cid) == true then if getPlayerGuildId(cid) ~= getGlobalStorageValue(STORAGE_GUILD_WIN) then doBroadcastMessage("O(a) Jogador "..getCreatureName(cid).." esta tentando invadir o castle da guild \""..getPlayerGuildName(cid) ..".", MESSAGE_STATUS_CONSOLE_BLUE) else doPlayerSendCancel(cid,"Avance") end else doPlayerSendCancel(cid,"Avance") end return true end Não entendi muito bem o "tempo para o player passar no tile", isso seria quando alguém passa próximo tem que esperar tanto tempo pra passar?
Postado Abril 15, 2016 9 anos Autor Em 15/04/2016 em 18:58, DukeeH disse: Não entendi muito bem o "tempo para o player passar no tile", isso seria quando alguém passa próximo tem que esperar tanto tempo pra passar? Exemplo, passo no tile e aparece o brodcast, só depois de 5 segundos posso passar para aparecer o broadcast novamente.
Postado Abril 15, 2016 9 anos Tipo... Isso? local STORAGE_GUILD_WIN = GRANTOWER.SAVELASTWINNER function isPlayerGuild(cid) if(getPlayerGuildName(cid) ~= "") then return true end return false end local broadTab = { broadcastDelay = 5 -- em segundos } function onStepIn(cid, item, position, fromPosition) if(isPlayer(cid) and isPlayerGuild(cid)) then local cidTime = broadTab[getCreatureName(cid)] or 0 if(getPlayerGuildId(cid) ~= getGlobalStorageValue(STORAGE_GUILD_WIN) and cidTime < os.time()) then doBroadcastMessage("O(a) Jogador "..getCreatureName(cid).." esta tentando invadir o castle da guild \""..getPlayerGuildName(cid) ..".", MESSAGE_STATUS_CONSOLE_BLUE) broadTab[getCreatureName(cid)] = (os.time() + broadTab.broadcastDelay) end doPlayerSendCancel(cid, "Avance") end return true end
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.