Postado Junho 4, 2017 8 anos Autor 2 minutos atrás, klipstyle disse: vish maria sua source nao tem nenhuma função do script kkk' kkkkkkkk complicado kkkkkk @klipstyle esse é o script do comando /m de criar monstros, talvez algo seja útil Spoiler function onSay(player, words, param) if not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GOD then return false end local position = player:getPosition() local monster = Game.createMonster(param, position) if monster ~= nil then if monster:getType():isRewardBoss() then monster:setReward(true) end monster:getPosition():sendMagicEffect(CONST_ME_TELEPORT) position:sendMagicEffect(CONST_ME_MAGIC_RED) else player:sendCancelMessage("There is not enough room.") position:sendMagicEffect(CONST_ME_POFF) end return false end @klipstyle eu editei o script agora não ta dando mais erro porem não criar o mostro Spoiler local monster = {"Bug", "Orc", "Spider"} -- Monstros que serão criados. local position = getCreaturePosition(cid) -- Posição que monstros vão nascer. local exhausted = 5 -- Tempo em segundos para usar. local level = 20 -- Level minimo para usar. local storage = 5415 -- Registro para salvar tempo. function onUse(cid, item, frompos, itemEx, topos) if(os.time() < getPlayerStorageValue(cid, storage)) then doPlayerSendCancel(cid, 'You can only call a monster again after '.. exhaustion.get(cid, storage) .. ' seconds.') return true end if getPlayerLevel(cid) >= level then setPlayerStorageValue(cid, storage, os.time() + exhausted) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You found a ".. monster[math.random(1, #monster)] ..".") isMonster(monster[math.random(1, #monster)], position) else doPlayerSendCancel(cid, 'You\'re too weak to call a monsters here, come back when you\'re level '.. level .. '.') end return true end
Postado Junho 4, 2017 8 anos Só uma duvida, que distro você ta usando? pelas funções eu diria que é TFS 1.x Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Junho 4, 2017 8 anos Autor 1 minuto atrás, Way20 disse: Só uma duvida, que distro você ta usando? pelas funções eu diria que é TFS 1.x TFS 1.2 a 1.3
Postado Junho 4, 2017 8 anos 19 minutos atrás, Adventure disse: TFS 1.2 a 1.3 Ta explicado o porque de tanto erro. Tenta agora. local config = { Monsters = {"Rat", "Bug", "Spider"}, -- Monstros que podem ser encontrados Exhausted = 120, -- Tempo em segundos TimeStorage = 4640 Level = 20 -- Level Minimo } function onUse(cid, item, frompos, item2, topos) local player = Player(cid) local position = player:getPosition() if player:getStorageValue(TimeStorage) >= os.time then player:sendCancel(cid, 'You can only look for monster again after '.. exhaustion.get(cid, 4640) .. ' seconds.') return true end if player:getLevel() >= config.Level then player:setStorageValue(TimeStorage, os.time + Exhausted) player:SendTextMessage(MESSAGE_EVENT_ADVANCE, "You found a ".. Monsters[math.random(1, #Monsters)] ..".") Game.createMonster(Monsters[math.random(1, #Monsters)], position) else player:sendCancel('You are too weak to look for monsters here, come back when you get level '.. level .. '.') end return true end Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Junho 4, 2017 8 anos Autor 4 minutos atrás, Way20 disse: Ta explicado o porque de tanto erro. Tenta agora. local config = { Monsters = {"Rat", "Bug", "Spider"}, -- Monstros que podem ser encontrados Exhausted = 120, -- Tempo em segundos TimeStorage = 4640 Level = 20 -- Level Minimo } function onUse(cid, item, frompos, item2, topos) local player = Player(cid) local position = player:getPosition() if player:getStorageValue(TimeStorage) >= os.time then player:sendCancel(cid, 'You can only look for monster again after '.. exhaustion.get(cid, 4640) .. ' seconds.') return true end if player:getLevel() >= config.Level then player:setStorageValue(TimeStorage, os.time + Exhausted) player:SendTextMessage(MESSAGE_EVENT_ADVANCE, "You found a ".. Monsters[math.random(1, #Monsters)] ..".") Game.createMonster(Monsters[math.random(1, #Monsters)], position) else player:sendCancel('You are too weak to look for monsters here, come back when you get level '.. level .. '.') end return true end [Warning - Event::checkScript] Can not load script: scripts/arvore.lua data/actions/scripts/arvore.lua:5: '}' expected (to close '{' at line 1) near 'Level' esse bug tem a ver com essa chave ai que colocou } acho que ela ta no lugar errado ou algo assim
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.