
Tudo que MySticaL postou
-
[Talkaction] Comando que vê o ping
Vo dar uma atualizada aqui.
-
[Talkaction] Comando que vê o ping
Script Ping: Crie um arquivo em data/talkactions/scripts/ chamado de verping.lua após isso adicione o seguinte código dentro dele: function onSay(cid, words, param, channel) local mystical = ping.CheckPing(cid) doPlayerSendTextMessage(cid,22,"Ping aproximado --> ["..mystical.."].") return true end em data/talkactions/talkactions.xml adicione a seguinte tag: <talkaction words="!ping" event="script" value="verping.lua"/> em data/lib/ crie um arquivo chamado lib-ping.lua e coloque adicione este código: ping = { _VERSION = "1.0"; pinger = function() if not getPlayerLastPong then print('Error!') return false else return true end end, CONST_WATING_RESPONSE = -3, CONST_DISCONECTED = -2, } function ping.CheckPing(cid) local c = getPlayerLastPong(cid) local l = getPlayerLastPing(cid) local ping = math.floor((c-l)) return ping end function ping.loop(cid,storage,f,...) if not isPlayer(cid) then return false end local p_ing = ping.CheckPing(cid) if p_ing ~= CONST_WATING_RESPONSE then if not tonumber(p_ing) then doPlayerSetStorageValue(cid,storage,ping.CONST_DISCONECTED) return else doPlayerSetStorageValue(cid,storage,p_ing) f(cid,storage,p_ing,...) return end end addEvent(ping.loop,100,cid,storage,f,...) end function ping.getPing(cid,storage,f,...) if ping.test() then doPlayerSetStorageValue(cid,storage,ping.CONST_WATING_RESPONSE) doPlayerSendPing(cid) ping.loop(cid,storage,f,...) end end Print demostrativo Espero ter ajudado Créditos: Mock -- Criar as funções Eu -- Por está postando
-
[Action] Script Quest
Exatamente :D
- [PEDIDO] Npc Que Troca Nome Do Jogador...
- [PEDIDO] Npc Que Troca Nome Do Jogador...
- [PEDIDO] Npc Que Troca Nome Do Jogador...
-
[PEDIDO] Npc Que Troca Nome Do Jogador...
Amigo não entendi o "negócio de 5 pontos", mais editei esse script aqui e traduzi para você usar no caso ele renomeia o player por certo item e quantidade. "CONFIGURAVEL" Em Npc crie um arquivo chamado renameplayers.xml, após isso coloque o seguinte código nele. <?xml version="1.0" encoding="UTF-8"?> <npc name="Renomeador" script="renn.lua" walkinterval="0" floorchange="0"> <health now="150" max="150"/> <look type="299" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|, Deseja trocar seu nome por apenas 5 Pontos?"/> </parameters> </npc> Em Npc/script crie um arquivo chamado renn.lua, após isso coloque o seguinte código nele. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talk = {} local name = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function onPlayerEndTrade(cid) npcHandler:nPlayerEndTrade(cid) end function onPlayerCloseChannel(cid) npcHandler:nPlayerCloseChannel(cid) end function creatureGreetCallback(cid) talk[cid] = name[cid] = '' return true end local chars = {' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'} RET_VALID = 1 RET_EXISTS = 2 RET_INVALID = 3 local function validName(name) if getPlayerGUIDByName(name) ~= nil then return RET_EXISTS end local notAllowed = {"god", "gm", "cm", "tutor", "help", "admin"} for _, naw in pairs(notAllowed) do if (name:lower():find(naw .. " ") or name:lower() == naw or name:lower():find("admin")) then return RET_INVALID end end for i = 1, name:len() do if not(isInArray(chars, name:sub(i,i))) then return RET_INVALID end end return RET_VALID end local function getValid(name, opt) local function tchelper(first, rest) return first:upper()..rest:lower() end return opt and name:gsub("(%a)([%w_']*)", tchelper) or name:gsub("^%l", string.upper) end local config = { type = 'item', money = 10000, -- = ignore item = {2159, 20}, -- Item, quantidade everyFirstLetterCapital = true } function messageDefaultCallback(cid, type, msg) if not(npcHandler:isFocused(cid)) then return false end if msgcontains(msg, "yes") and talk[cid] == then selfSay("Ok, Qual o nome Desejado?", cid) talk[cid] = 1 elseif talk[cid] == 1 then local v = getValid(msg:lower(), config.everyFirstLetterCapital) local ret = validName(v) if ret == RET_VALID then selfSay("Então você quer '" .. v .. "' para ser seu nickname novo, irá custar: " .. (config.type == "money" and (config.money .. " gold") or (config.item[2] .. ' ' .. (config.item[2] > 1 and getItemPluralNameById(config.item[1]) or getItemNameById(config.item[1])))) .. "?", cid) talk[cid], name[cid] = 2, v else if ret == RET_INVALID then selfSay(msg .. " Não é um nome válido, diga me outro nome", cid) elseif ret == RET_EXISTS then selfSay(msg .. " Já existe diga-me outro nome", cid) end end elseif talk[cid] == 2 then if msgcontains(msg, "yes") then if (config.type == 'money' and doPlayerRemoveMoney(cid, config.money)) or (config.type ~= 'money' and doPlayerRemoveItem(cid, config.item[1], config.item[2])) then local curName = getPlayerName(cid) doRemoveCreature(cid) db.executeQuery("UPDATE players SET name = '"..name[cid].."' WHERE name = '"..curName.."';") else selfSay("Você não tem 5 Pontos :(", cid) talk[cid] = end else selfSay("Talvez mais tarde.", cid) talk[cid] = end end return true end npcHandler:setMessage(MESSAGE_FAREWELL, "Tchau.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Até logo!") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, messageDefaultCallback) npcHandler:setCallback(CALLBACK_FAREWELL, creatureFarewell) npcHandler:setCallback(CALLBACK_CREATURE_DISAPPEAR, creatureFarewell) npcHandler:setCallback(CALLBACK_GREET, creatureGreetCallback) npcHandler:addModule(FocusModule:new()) Como configurar: local config = { type = 'item', -- Não mecha money = 10000, -- ignore item = {2159, 20}, -- Item, quantidade everyFirstLetterCapital = true
- [Ajuda] Criar Sprite na parede
- Não logar client desatualizado
- [Ajuda] Criar Sprite na parede
- Como eu adiciono novos items e sprites no Remeres Map Editor?
- [Ajuda] Criar Sprite na parede
- Não logar client desatualizado
-
Olá onde fica os comandos no serve poketibia em que pasta?
data/talkactions/talkactions.xml abre com bloco de notas e bota lá em acess 5
- [Ajuda] Criar Sprite na parede
-
Criar item
você adicionou no ot item editor ?
- Não logar client desatualizado
- [PEDIDO]Como criar um laucher para meu client
-
Ajuda EarthQuake
aviso para quem não sabe ainda na base kpdo a distância dos attacks fica em otserv/data/lib/talkactions.lua lá fica as distâncias de alguns atacks e para Pda é em otserv/data/lib/areas.lua Descobri sozin wieowe
- [Ajuda] Criar Sprite na parede
-
[Action] Script Quest
Oks Valeu pela dica sou novo ainda em script kk
-
[Action] Script Quest
Script Quest: --[[ Script: Exemplo de Quest Autor: MySticaL Email: [email protected] ]] function onUse(cid, item, frompos, item2, topos) -- Não mecha. storage = 938312 -- Storage a cada quest que for criada aumente um numero da storage pra qnd vc pegar o baú de outra quest ñ aparecer que vc já fez. item = 2160 -- Id do item ira ganhar. quantidade = 1 -- Quantidade ira ganhar. level = 5 -- Level que precisa pra fazer. if getPlayerLevel(cid) >= level and getPlayerStorageValue(cid,storage) == -1 then -- Não mecha. doPlayerSendTextMessage(cid,25,"Você ganhou um pouco de dinheiro") -- Mensagem que aparecera quando ganhar o item. doPlayerAddItem(cid, item, quantidade) -- Não mecha. setPlayerStorageValue(cid,storage,1) -- Não mecha. elseif getPlayerLevel(cid) <= level then -- Não mecha doPlayerSendTextMessage(cid,25,"Você precisa ser level 5 ou mais.") -- Mensagem que ira aparecer se o player tiver menos level que o necessario. elseif getPlayerStorageValue(cid,storage) >= 1 then -- Não mecha. doPlayerSendTextMessage(cid,25,"Você já fez está quest") -- Quando tentar pegar mais de uma vez o baú. end return true end Actions.xml <action actionid="3123" event="script" value="script.lua"/> Obs: O actionid="3123" é o que você deve botar no item no Remeres Map Editor Caso você queria criar outra quest aumente a storage no script e o id no actions.xml ! Como configurar ? R- \/ ================================================================================================================================ storage = 938312 -- Storage a cada quest que for criada aumente um numero da storage pra quando você for pegar o baú de outra quest não aparecer que você já fez. ================================================================================================================================ item = 2160 -- Id do item ira ganhar. ====================================================== quantidade = 1 -- Quantidade ira ganhar. ====================================================== level = 5 -- Level que precisa pra fazer. ====================================================== Script bem simples mais irá ajudar alguns membros. Rep não cai o dedo Não sei muito sobre script. 100% Créditos meu caso for postar em outro lugar deixe os créditos para min ! Desculpem o tópico mal arrumado
-
Ajuda criar sprite
Nem eu tirando tempo não vou conseguir pq não so spriter nem sei por onde corto :x
-
Ajuda criar sprite
Ei, poderia me mandar pronto já ? se bem que fiz na minha base antiga mais troquei e to sem tempo para arrumar tudo do object builder tem como me mandar pronto .obd ? (Object Builder)
-
Ajuda EarthQuake
Seis são tudo burrão '-', não tem nada ver com Spr e dat é no proprio servidor na pasta lib '-' ja consegui