Postado Setembro 9, 2017 7 anos Galera preciso de uma script universal de alacava de treines como nas imagens, vlw abrç
Postado Setembro 9, 2017 7 anos Se você fizer no seu servidor semelhante ao modo como esse mapa está: Em actions/scripts crie um arquivo: trainerlever.lua Spoiler local function isWalkable(cid, pos) pos.stackpos = 0 if getTileThingByPos(pos).uid ~= 0 then local n = getTileInfo(pos) if n.protection == false and n.house == false and getTopCreature(pos).uid == 0 and doTileQueryAdd(cid, pos) == RETURNVALUE_NOERROR then return true end end end function onUse(cid, item, fromPosition, itemEx, toPosition) for i = -1, 1 do for j = -1, 1 do local train_pos = {x = toPosition.x + i, y = toPosition.y-j, z = toPosition.z} if isWalkable(cid, train_pos) then doTeleportThing(cid, train_pos) doSendMagicEffect(train_pos, CONST_ME_TELEPORT) return true end end end return doPlayerSendCancel(cid, "There is another player training.") end Em actions.xml, adicione a tag: <action actionid="ACTIONID_DA_ALAVANCA" script="trainerlever.lua" /> Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Setembro 24, 2017 7 anos Solução Sua versão de tfs era diferente. O correto é esse: Spoiler function onUse(player, item, fromPosition, target, toPosition, isHotkey) local isWalkable = function (position) local tile = Tile(position) if not tile then return false end if tile:getTopCreature() then return false end local ground = tile:getGround() if not ground or ground:hasProperty(CONST_PROP_BLOCKSOLID) then return false end local items = tile:getItems() for i = 1, tile:getItemCount() do local item = items[i] local itemType = item:getType() if itemType:getType() ~= ITEM_TYPE_MAGICFIELD and not itemType:isMovable() and item:hasProperty(CONST_PROP_BLOCKSOLID) then return false end end return true end for i = -1, 1 do for j = -1, 1 do local train_pos = Position(toPosition.x + i, toPosition.y - j, toPosition.z) if isWalkable(train_pos) then player:teleportTo(train_pos) train_pos:sendMagicEffect(CONST_ME_TELEPORT) return true end end end return player:sendCancelMessage("There is another player training.") end Contato: Email: [email protected] Discord: Dwarfer#2715
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.