
Tudo que Vodkart postou
-
Ajuda com esse script de yellow skull em x Area
local from,to = {x=1251,y=716,z=6},{x=1259,y=724,z=6} function onThink(interval) for _, cid in pairs(Game.getPlayers()) do if isInRange(Player(cid):getPosition(), from, to) then Player(cid):setSkull(SKULL_YELLOW) end end return true end
-
remover speed da criatura e depois retornar
acho melhor fazer por C++ esse código já está disponível https://otland.net/threads/passive-monsters-attack-when-attacked.232475/
-
Ajuda com esse script de yellow skull em x Area
function onThink(player, interval, item, position, lastPosition, fromPosition, toPosition) local area = {{x=1251,y=716,z=6},{x=1259,y=724,z=6}} for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isPlayer(m) then doCreatureSetSkullType(m, SKULL_YELLOW) end end end return true end
-
Ajuda com esse script de yellow skull em x Area
function onThink(player, interval, item, position, lastPosition, fromPosition, toPosition) local area = {{x=1251,y=716,z=6},{x=1259,y=724,z=6}} for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isPlayer(m) then m:setSkull(SKULL_YELLOW) end end end return true end
-
[RESOLVIDO] getDataString
local id = getThingfromPos({x=1445,y=1273,z=7,stackpos=0}).actionid - 50000 local guild = db.getResult("SELECT `guild` FROM `castle_wars` WHERE `id` = " .. id .." ORDER BY `id` DESC;") if getPlayerStorageValue(cid, 50095) < os.time() then for t=1,#posEntrando do if (fromPosition.x == posEntrando[t].x and fromPosition.y == posEntrando[t].y and fromPosition.z == posEntrando[t].z) then if (guild:getID() ~= -1) then doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"Bem vindo à cidade de Agniter, controlada pela guild "..guild:getDataString("guild")..".") doPlayerSetStorageValue(cid, 50095, os.time() + 60) end end end
-
Sistema de Rep+
@JujuLady function onSay(cid, words, param) if words == "!rep" then local p = getPlayerByName(param) if not p then doPlayerSendTextMessage(cid, 27, "Player Not Found.") return true elseif getPlayerIp(cid) == getPlayerIp(p) or getPlayerAccount(cid) == getPlayerAccount(p) then doPlayerSendTextMessage(cid, 27, "IP ACCOUNT PROTECT.")return true end setPlayerStorageValue(p, 6001, getPlayerStorageValue(p, 6001) <= 0 and 1 or getPlayerStorageValue(p, 6001) + 1) doPlayerSendTextMessage(cid, 27, "You gave reputation + 1 for " .. getCreatureName(p) .. ".") doPlayerSendTextMessage(p, 21, "You received reputation + 1 of ".. getCreatureName(cid) ..".") return true elseif words == "!myrep" then return doPlayerSendTextMessage(cid, 27, "My Reputation : " .. (getPlayerStorageValue(cid, 6001) <= 0 and 0 or getPlayerStorageValue(cid, 6001))) elseif words == "!rankrep" then local e = getPlayersOnline() local text = "" for _, pid in ipairs(e) do text = text .. "[" .. getCreatureName(pid) .. "] Reputation: " .. getPlayerStorageValue(pid, 6001) .. "\n\n" end text = "[RANK REPUTATION ONLINES]\n\n" .. text return doShowTextDialog(cid, 12945, text) end return true end --------- Esse sistema de rank é ruim, não mostra em "cascata" os top rank, mostra os que estão online e a quantidade de rep, aparece até se tiver -1 ou 0 de rep...
-
Script Pontuação
Eu entendi muito bem cara, só falei como fazer, sacas? só usar o onStepIn + storage e executar uma função a cada 1 segundo, para dar o point e mandar a fala em orange... como eu disse, se eu tiver tempo ainda essa semana te entrego. O script ai de cima, é para dar os points dependendo da "cor" do seu HP.
-
Script Pontuação
tendi, script fácil, se eu tiver tempo em casa eu faço, pra quem n sabe, a porcentagem do life funciona assim: local maxHealth = 6000 -- getCreatureMaxHealth(cid) local myHealth = 3000 -- getCreatureHealth(cid) local percent = math.floor((myHealth*100)/maxHealth) local points = percent >= 60 and 1 or percent >= 30 and percent < 60 and 2 or 3 print(points) usei uma base só pro pessoal saber do life vermelho, amarelo e verde. verde = 60% ou mais de vida do jogador amarelo = 30 a 60% de vida do jogador vermelho = 30% ou menos de vida do jogador nesse código usei uma base de a vida total do jogador ser 6k e ter atual 3k de vida, dando 50% de vida, ou seja, 2 points
-
Script Pontuação
Vai receber essa pontuação a cada 1 segundo? se morrer ficará salva? ou seja, é acumulativo, certo? o jogador que chegar a uma quantia "X" não recebe mais a pontuação?
-
Ajuda erro em função TFS 1.0
function getPlayerReset(cid) return db.getResult("SELECT `reset` FROM `players` WHERE `id = "..getPlayerGUID(cid)):getDataInt("resets") end function onUse(cid, item, fromPosition, itemEx, toPosition) local reset = 20 if getPlayerReset(cid) < reset then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa ter "..reset.." resets para passar.") end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition) return true end
-
(Resolvido)[PEDIDO] Script TOP LEVEL
- Porta selada só abre se o player Tiver x Storage
function onUse(player, item, frompos, item2, topos) local storage = 157201 if player:getStorageValue(storage) <= 0 then return player:sendCancelMessage("voce nao tem permissao.") end doTransformItem(item.uid, item.itemid + 1) player:teleportTo(topos) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"Welcome, Lucca Noob.") return true end- (Resolvido)Piso ou porta de resets
function getPlayerReset(cid) local query = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return query:getDataInt("reset") <= 0 and 0 or query:getDataInt("reset") end function onStepIn(cid, item, position, fromPosition) local resets = 20 if getPlayerReset(cid) < resets then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "voce precisa de "..resets.." para passar neste tile.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end return true end- Como posso kikar automaticamente quando acabar Premium account de um player?
function onThink(interval, lastExecution, thinkInterval) if #getPlayersOnline() > 0 then for _, cid in ipairs(getPlayersOnline()) do doPlayerSave(cid) if isPremium(cid) and getPlayerStorageValue(cid, 78945) <= 0 then setPlayerStorageValue(cid,78945, 1) elseif not isPremium(cid) and getPlayerStorageValue(cid, 78945) > 0 then doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You premium is Over!") setPlayerStorageValue(cid, 78945, -1) end end end return true end- (Resolvido)bug GuildFragSystem
tais usando o mods né? fala comigo inbox- (Resolvido)bug GuildFragSystem
se eu não me engano eu não fiz tile nesse sistema, só fiz um uma door que você coloca o actionID "84005" mas posso fazer o tile sem problemas- [TALKACTION] Caixa Postal
- (Resolvido)bug GuildFragSystem
é pq teu serve o globale events é em milesegundos tem que trocar o "interval" do globalevents, por exemplo está 1800 -- no meu serve seria a cada 30 minutos no seu 60000 significa 1 minuto, entendeu? só aumentar aquele time do interval- Presente Diario (8.6x)
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower() local config = { level = 120, hours = 24, storage = 58485, rewards = {{itemid = 2173,chance = 15},{itemid = 2123,chance = 25},{itemid = 2160,chance = 30}} -- itens que ele poderá ganhar } function doAddReward() a = true while a == true do local m = math.random(1,#config.rewards) if config.rewards[m].chance > math.random(1, 100) then doPlayerAddItem(cid, config.rewards[m].itemid, isItemStackable(config.rewards[m].itemid) and 100 or 1) npcHandler:say("seu prêmio foi: "..getItemNameById(config.rewards[m].itemid), cid) a = false end end end if isInArray({"presente","present"}, msg) then if getPlayerLevel(cid) < config.level then npcHandler:say("Desculpe, mas você precisa ter no minimo level "..config.level.." para receber sua recompensa diaria.", cid) else npcHandler:say("você deseja receber seu presente agora?! {yes}", cid) talkState[talkUser] = 1 end elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerStorageValue(cid,config.storage) <= os.time() then doAddReward() setPlayerStorageValue(cid, config.storage, os.time()+config.hours*3600) else npcHandler:say("Desculpe, mas você deve aguardar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." para pegar seu presente novamente!", cid) talkState[talkUser] = 0 end elseif msg == "no" then selfSay("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ok- [Mod] Trade Logs
quando o jogador passa os itens pelo trade, fica salvo esses dados, os itens que foram trocados e os players que trocaram- TopLevel Effect
local config = { tempo = 5, --tempo em segundos mensagem = { texto = "[TOP]", --não use mais de 9 caracteres efeito = TEXTCOLOR_LIGHTBLUE --efeito para a função doSendAnimatedText }, efeito = 30, --efeito da função doSendMagicEffect globalstr = 150202 -- uma global storage qualquer q esteje vazia } function TopEffect(cid) local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',') if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end doSendAnimatedText(getCreaturePosition(cid), config.mensagem.texto, config.mensagem.efeito) doSendMagicEffect(getCreaturePosition(cid), config.efeito) addEvent(TopEffect, config.tempo*1000, cid) end function onLogin(cid) if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if (query:getID() ~= -1) then setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level")) TopEffect(cid) end else TopEffect(cid) end registerCreatureEvent(cid, "CheckTop") return true end function onAdvance(cid, skill, oldLevel, newLevel) if skill ~= SKILL__LEVEL then return true end local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',') if newLevel > tonumber(var[2]) and getPlayerName(cid) ~= var[1] then doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22) setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel) TopEffect(cid) end return true end- Tell-a-Friend
@Jobs SIm, isso mesmo, o sistema é meu, não só vou trazer, mas com melhorias e com Versão 8.6 e Versão tfs 1.2+ infelizmente estou sem tempo, devido a faculdade, até tive que parar alguns projetos, mas depois de quarta volto á ativa. Um abraço.- (Resolvido)[SCRIPT] Item para Last Hit
é porque vc está registrando o event no player tbm... o certo seria só adc no monstro.- Critical Skill System
- Critical Skill System
- Porta selada só abre se o player Tiver x Storage
Informação Importante
Confirmação de Termo