Postado Fevereiro 20, 2023 2 anos --[[ Observação: No mapa colocar o uid 5032 na estátua que dará recompensa No mapa colocar o uid 5033 na estátua que teleportará o jogador para dentro da sala ]] local config = { reward = { id = 2152, amount = 50 }, playerLevel = 100, playerTeleportTo = { x = 100, y = 100, z = 7 }, checkArea = { fromPosition = { x = 100, y = 100, z = 7 }, toPosition = { x = 100, y = 100, z = 7 } }, monsterName = "Papao", monsterSpawnPosition = { x = 100, y = 100, z = 7 }, exitPosition = { x = 100, y = 100, z = 7 }, time = 5, } function onUse(cid, item, frompos, item2, topos) if item.uid == 5032 then local storage = 1164372809 if getPlayerStorageValue(cid, storage) < 1 then setPlayerStorageValue(cid, storage, 1) doPlayerAddItem(cid, config.reward.id, config.reward.amount) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce foi recompensado com 5000 gold coins.") end doTeleportThing(cid, config.exitPosition, false) end if item.uid == 5033 then local storage, fromPos, toPos = 6431953401, config.checkArea.fromPosition, config.checkArea.toPosition local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) local monster_, player_ = 0, 0 for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do local pid = getTopCreature({ x = x, y = y, z = z }).uid if ((isMonster(pid)) and (getCreatureName(pid) == config.monsterName)) then monster_ = monster_ + 1 end if isPlayer(pid) then player_ = player_ + 1 end end end end if ((getPlayerLevel(cid) < config.playerLevel) and (getPlayerAccess(cid) < 3)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Precisa ter pelo menos nivel " .. config.playerLevel) return true end if ((check < 0) and (getPlayerAccess(cid) < 3)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Faz menos de " .. config.time .. " minutos que voce enfrentou o monstro.") return true end if ((player_ > 0) and (getPlayerAccess(cid) < 3)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Alguem esta na sala!") return true end if monster_ < 1 then doSummonCreature(config.monsterName, config.monsterSpawnPosition) end doTeleportThing(cid, config.playerTeleportTo, false) setPlayerStorageValue(cid, storage, (now + (60 * config.time))) end return true end
Postado Fevereiro 23, 2023 2 anos Moderador 29 minutos atrás, Straikar disse: Tudo certo, resolvemos por discord, obrigado a força Se puder, coloca o script por gentileza, que ficou certinho, pois também pode ser que alguma outra pessoa precise também, e já ajudaria a comunidade
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.