Ir para conteúdo

Vodkart

Héroi
  • Registro em

Solutions

  1. Vodkart's post in (Resolvido)[AJUDA] Spell que remove buff was marked as the answer   
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 238) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -40.2, 1, -40.2, 1) function onCastSpell(cid, var) local target = getCreatureTarget(cid) local storage = 102053 -- Storage que ta em Todos os BUffs, alguns pode não está, então coloque a mesma storage em todos os buff. if isPlayer(target) then if getPlayerStorageValue(target, storage) == 1 then setPlayerStorageValue(target, storage, 0) doRemoveConditions(target, false) doRemoveCondition(target, CONDITION_ATTRIBUTES, jin_cond_id) return doCombat(cid, combat, var) else doPlayerSendTextMessage(cid, 20, "O Player já está sem Buff.") end else doPlayerSendTextMessage(cid, 20, "Você só pode usar este Jutsu em Players, pois monstros não tem Buff.") end return true end  
  2. Vodkart's post in (Resolvido)error login.lua:onlogin Description:( luadoplayersendtextmessage) Player not found was marked as the answer   
    local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str .. "Hello ." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type {account} to manage your account and if you want to start over then type {cancel}.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type {account} to create an account or type {recover} to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "critical") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "advance") registerCreatureEvent(cid, "TopFrags") registerCreatureEvent(cid, "FimVip") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "VipReceive") registerCreatureEvent(cid, "expvip") registerCreatureEvent(cid, "PlayerKill") registerCreatureEvent(cid, "AuraLogin") registerCreatureEvent(cid, "Auto Loot") registerCreatureEvent(cid, "vipeffects") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "TopEffect") registerCreatureEvent(cid, "BlessAmulet") registerCreatureEvent(cid, "ProtectLevel") registerCreatureEvent(cid, "hmup") registerCreatureEvent(cid, "Popup1") registerCreatureEvent(cid, "blesscheck") registerCreatureEvent(cid, "AdvEffect") registerCreatureEvent(cid, "CastleExp") registerCreatureEvent(cid, "DesertDeath") registerCreatureEvent(cid, "DesertCombat") registerCreatureEvent(cid, "BattleDeath") registerCreatureEvent(cid, "ZombieThink") registerCreatureEvent(cid, "ZombieDeath") registerCreatureEvent(cid, "BattleCombat") registerCreatureEvent(cid, "FragsGuildLogin") registerCreatureEvent(cid, "FragsGuildKill") registerCreatureEvent(cid, "ctf") registerCreatureEvent(cid, "ga1") registerCreatureEvent(cid, "ga2") registerCreatureEvent(cid, "ga3") registerCreatureEvent(cid, "gv1") registerCreatureEvent(cid, "gv2") registerCreatureEvent(cid, "gv3") if (InitArenaScript ~= 0) then InitArenaScript = 1 -- make arena rooms free for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena registerCreatureEvent(cid, "deathchannel") if getPlayerStorageValue(cid, 48913) == -1 then setPlayerStorageValue(cid, 48913, 0) end return true end  
  3. Vodkart's post in (Resolvido)unexpected sylbol near "´" no meu login.lua. Leiam a descrição. was marked as the answer   
    local config = { loginMessage = getConfigValue("loginMessage"), useFragHandler = getBooleanFromString(getConfigValue("useFragHandler")) } function onLogin(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str .. "Hello ." doPlayerSendTextMessage(cid) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type {account} to manage your account and if you want to start over then type {cancel}.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type {account} to create an account or type {recover} to recover an account.") end if (not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "critical") registerCreatureEvent(cid, "recompensa") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "advance") registerCreatureEvent(cid, "TopFrags") registerCreatureEvent(cid, "FimVip") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "VipReceive") registerCreatureEvent(cid, "expvip") registerCreatureEvent(cid, "PlayerKill") registerCreatureEvent(cid, "AuraLogin") registerCreatureEvent(cid, "Auto Loot") registerCreatureEvent(cid, "vipeffects") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "TopEffect") registerCreatureEvent(cid, "BlessAmulet") registerCreatureEvent(cid, "ProtectLevel") registerCreatureEvent(cid, "TiraBattle") registerCreatureEvent(cid, "hmup") registerCreatureEvent(cid, "Popup1") registerCreatureEvent(cid, "blesscheck") registerCreatureEvent(cid, "AdvEffect") registerCreatureEvent(cid, "CastleExp") registerCreatureEvent(cid, "DesertDeath") registerCreatureEvent(cid, "DesertCombat") registerCreatureEvent(cid, "BattleDeath") registerCreatureEvent(cid, "ZombieThink") registerCreatureEvent(cid, "ZombieDeath") registerCreatureEvent(cid, "BattleCombat") registerCreatureEvent(cid, "FragsGuildLogin") registerCreatureEvent(cid, "FragsGuildKill") registerCreatureEvent(cid, "ctf") registerCreatureEvent(cid, "ga1") registerCreatureEvent(cid, "ga2") registerCreatureEvent(cid, "ga3") registerCreatureEvent(cid, "gv1") registerCreatureEvent(cid, "gv2") registerCreatureEvent(cid, "gv3") if (InitArenaScript ~= 0) then InitArenaScript = 1 for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) end setPlayerStorageValue(cid, 42350, 0) setPlayerStorageValue(cid, 42352, 0) registerCreatureEvent(cid, "deathchannel") if getPlayerStorageValue(cid, 48913) == -1 then setPlayerStorageValue(cid, 48913, 0) end return true end  
    OBS: tais usando o onlogin.lua certo? porque tem server que tem mais de um, podendo entrar em conflito e tal, é bom dar uma visualizada nisso.
  4. Antes de mais nada execute essas querys no seu banco de dados
     
    ALTER TABLE `guilds` ADD `frags` INT(11) NOT NULL DEFAULT 0; ALTER TABLE `guilds` ADD `acesstime` INT(15) NOT NULL DEFAULT 0;  
  5. Vodkart's post in (Resolvido)Mana e Life Scroll por vocation com Limite was marked as the answer   
    local storage = 342005 function onSay(cid, words, param) local limit = isInArray({1,2,5,6}, getPlayerVocation(cid)) and 200 or isInArray({3,7}, getPlayerVocation(cid)) and 100 or 0 local amount = getPlayerStorageValue(cid, storage) <= 0 and 0 or getPlayerStorageValue(cid, storage) if limit <= 0 or amount == limit then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "voce nao pode usar ou atingiu o limite maximo de "..limit.." Mana Scroll por character.") return true end if doPlayerRemoveItem(cid,9020,1) and getCreatureMaxMana(cid) <= 1900000 then setPlayerStorageValue(cid, storage, amount+1) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 1000) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "voce recebeu 1000 de Mana.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Voce nao tem Mana scroll ou ja atingiu o Mana Maximo de mana permitido digite !mymp.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA) end return true end  
    --
     
    local storage = 342006 function onSay(cid, words, param) local limit = isInArray({4,8}, getPlayerVocation(cid)) and 200 or isInArray({3,7}, getPlayerVocation(cid)) and 100 or 0 local amount = getPlayerStorageValue(cid, storage) <= 0 and 0 or getPlayerStorageValue(cid, storage) if limit <= 0 or amount == limit then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "voce nao pode usar ou atingiu o limite maximo de "..limit.." Life Scroll por character.") return true end if doPlayerRemoveItem(cid,11213,1) and getCreatureMaxHealth(cid) <= 1900000 then setPlayerStorageValue(cid, storage, amount+1) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 1000) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "voce recebeu 1000 de Life.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Voce nao tem life scroll ou ja atingiu o LIFE Maximo de life permitido digite !myhp.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA) end return true end  
     
     
  6. Vodkart's post in (Resolvido)Evento PvP was marked as the answer   
    testa assim, se funcionar depois eu coloco em determinado horário.
     
     
    function onThink(interval, lastExecution) local storage = {24658,24659} -- ALTERAR storage usado no sistema deixar todos iguais local items = {{2160,1500},{9020,300}} -- itens local arena = {{x = 1024, y = 892, z = 12},{x = 1224, y = 1085, z = 12}} -- area positions if getGlobalStorageValue(storage[1]) <= 0 then return true end function getPlayersInLixoEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), arena[1], arena[2]) and getPlayerAccess(pid) < 3 then t[#t+1] = pid end end return t end function getLixoRewards(cid, items) local backpack = doPlayerAddItem(cid, 10518, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function checkArenaLixo() if #getPlayersInLixoEvent() > 1 then addEvent(checkArenaLixo, 3000) -- ainda em batalha elseif #getPlayersInLixoEvent() == 1 then local cid = getPlayersInLixoEvent()[1] setGlobalStorageValue(storage[1], -1) setGlobalStorageValue(storage[2], -1) getLixoRewards(cid, items) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você é o Vencedor do Evento.") -- ALTERAR frase para o vencedor do premio doBroadcastMessage("O Player "..getPlayerName(cid).." é o Vencedor do Evento.",22) -- ALTERAR frase para todos, do ganhador do premio else setGlobalStorageValue(storage[1], -1) setGlobalStorageValue(storage[2], -1) doBroadcastMessage("Todos os Jogadores Se mataram, fim do Evento.",22) -- ALTERAR frase para todos, do ganhador do premio end end if getGlobalStorageValue(storage[2]) <= 0 then setGlobalStorageValue(storage[2], 1) addEvent(checkArenaLixo, 3000) end return true end  
  7. Vodkart's post in (Resolvido)Zombie Nojento was marked as the answer   
    local config = { semana_mes = "semana", days = {1,2,3,4,5,6,7}, -- Dia das semanas que irá acontecer o evento goblet = 5805, -- Troféu que vai pro vencedor do evento rewards = {2195, 2152, 2160}, -- Recompensas. moneyReward = {2160, 10, 1},-- moneyId, quantidade, usar1 pra usar 0 pra não usar playerCount = 2001, -- Storage dos players que entram e sai do evento zombieCount = 2002, -- Storage do zombie do event teleportActionId = 2008, -- Action ID do teleport teleportPosition = {x = 652, y = 1020, z = 7, stackpos = 1}, -- Onde o teleport é criado teleportToPosition = {x = 559, y = 589, z = 7}, -- Pra onde será teleportad?o teleportId = 1387, -- ID do teleporte timeToStartEvent = 2, -- Minutos que o portal irá ficar aberto até os player entrarem timeBetweenSpawns = 20, -- Segundos dps do evento ser startado começarem a aparecer os zombie zombieName = "event zombie", -- Nome do zombie sumonado playersNeededToStartEvent = 3, -- Players necessários pro evento ser iniciado -- Area que o zumbi vai spawnar fromPosition = {x = 543, y = 578, z = 7}, -- top de fromPosition até toPosition = {x = 577, y = 600, z = 7} -- -- em baixo toPostion } function onTime() local time = os.date("*t") if (config.semana_mes == "semana" and isInArray(config.days,time.wday)) or (config.semana_mes == "mes" and isInArray(config.days,time.day)) or config.semana_mes == "" then local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) end return true end function startEvent() local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") pvgaylord() end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) else local fromp, top = config.fromPosition, config.toPosition for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} cid = getThingfromPos(areapos).uid if isPlayer(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doBroadcastMessage(getCreatureName(cid)..' has survived at zombie event!') for _,items in ipairs(config.rewards) do doPlayerAddItem(cid, items, 1) end if config.moneyReward[3] == 1 then doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2]) end doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING) local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") elseif isMonster(cid) then doRemoveCreature(cid) end end end end end end function pvgaylord() local fromp, top, p, m = config.fromPosition, config.toPosition, 0, 0 for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do local areapos = {x = x, y = y, z = z, stackpos = 253} local cid = getThingfromPos(areapos).uid if isPlayer(cid) then p = p+1 elseif isMonster(cid) then m = m+1 end end end end if p ~= getGlobalStorageValue(config.playerCount) then setGlobalStorageValue(config.playerCount, p) end if p < 2 then return true end addEvent(pvgaylord,100,nil) end  
  8. Vodkart's post in (Resolvido)Error - NpcScript Interface was marked as the answer   
    execute a seguinte QUERY em seu banco de dados
     
     
    ALTER TABLE `accounts` ADD `p_points` INTEGER NOT NULL DEFAULT 0  
    qualquer coisa o sistema é esse: https://tibiaking.com/forums/topic/8183-system-pontos-p-points-system/?_fromLogin=1
  9. Vodkart's post in (Resolvido)Membros da staff esta no !rank was marked as the answer   
    ta configurado para aparecer só id maior que 6 kk
     
    nessa parte do código 
     
    WHERE `id` > 6 AND  
    coloca maior que 2
     
    WHERE `id` > 2 AND  
     
    da CTRL + F e troque o 6 por 2!!
     
    abraços
     
    ------------------------------
     
     
    modaldialog2 = { title = "Rank System", message = "Selecione a classificação que você quer ver:", buttons = { { id = 1, value = "Ver" }, { id = 2, value = "Sair" }, }, buttonEnter = 1, buttonEscape = 2, choices = { { id = 1, value = "Rank Soco" }, { id = 2, value = "Rank Clava" }, { id = 3, value = "Rank Espada" }, { id = 4, value = "Rank Machado" }, { id = 5, value = "Rank Distancia" }, { id = 6, value = "Rank Escudo" }, { id = 7, value = "Rank Pesca" }, { id = 8, value = "Rank Magia" }, { id = 9, value = "Rank Level" } }, popup = false } function getGroupDb(player_id) local query = db.getResult("SELECT `group_id` FROM `players` WHERE `id`= "..player_id) return query:getDataInt("group_id") end function callback2(cid, button, choice) if (button == 1) then local str = "" if (choice == 1) then str = "--[ Rank Soco ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 0 ORDER BY `value` DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 2) then str = "--[ Rank Clava ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 1 ORDER BY `value` DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 3) then str = "--[ Rank Espada ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 2 ORDER BY `value` DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 4) then str = "--[ Rank Machado ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 3 ORDER BY `value` DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 5) then str = "--[ Rank Distancia ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 4 ORDER BY `value` DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 6) then str = "--[ Rank Escudo ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 5 ORDER BY `value` DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 7) then str = "--[ Rank Pesca ]--\n" query = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = 6 ORDER BY `value` DESC LIMIT 20;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end if getGroupDb(query:getDataString("player_id")) < 3 then str = str .. "\n " .. k .. ". "..(getPlayerNameByGUID(query:getDataString("player_id"))).." - [" .. query:getDataInt("value") .. "]" k = k + 1 end until not query:next() end elseif (choice == 8) then str = "--[ Rank Magia ]--\n" query = db.getResult("SELECT `maglevel`, `name` FROM `players` WHERE `id` > 2 AND `group_id` < 3 ORDER BY `maglevel` DESC LIMIT 20;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end str = str .. "\n " .. k .. ". "..(query:getDataString("name")).." - [" .. query:getDataInt("maglevel") .. "]" k = k + 1 until not query:next() end elseif (choice == 9) then str = "--[ Rank Level ]--\n" query = db.getResult("SELECT `name`, `level`, `experience` FROM `players` WHERE `id` > 2 AND `group_id` < 3 ORDER BY `experience` DESC LIMIT 20;") if (query:getID() ~= -1) then k = 1 repeat if k > 20 then break end str = str .. "\n " .. k .. ". "..(query:getDataString("name")).." - [" .. query:getDataInt("level") .. "]" k = k + 1 until not query:next() end end doShowTextDialog(cid, 5785, str) end end function onSay(cid, words, param) addDialog(modaldialog2, 1002, cid, callback2); return true end  
  10. Vodkart's post in (Resolvido)Alavanca de sacrifico com storage was marked as the answer   
    ta ai tenta assim:
     
    https://pastebin.com/raw/B8ZS1rnx
  11. Vodkart's post in (Resolvido)Ajuda com Erro was marked as the answer   
    function Paralizy(cid) if not isCreature(cid) then return LUA_ERROR end local HelmetID = 12692 --- ID DO ITEM if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == HelmetID then doRemoveCondition(cid, CONDITION_PARALYZE) addEvent(Paralizy, 1*100, cid) end return true end function onEquip(cid, item, slot) doRemoveCondition(cid, CONDITION_PARALYZE) addEvent(Paralizy, 1*100, cid) return true end  
  12. Vodkart's post in (Resolvido)Help Botar proibido usar spells em x lugar was marked as the answer   
    kk ainda bem que copiou bem certinho
     
     
    local config = {pos = {x=1765, y=578, z=7},tempo = 30,effect1 = 10,effect2 = 10} local areas ={ -- areas bloqueadas {from = {x=97, y=1773, z=7},to = {x=109, y=1785, z=7}}, -- Evento {from = {x=1008,y=1018,z=7},to = {x=1011,y=1021,z=7}} } function onCastSpell(cid, var) for _, var in ipairs(areas) do if isInRange(getCreaturePosition(cid), var.from, var.to) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce nao pode usar essa magia nesse local") return true end end if isPlayer(getCreatureTarget(cid)) then target = getCreatureTarget(cid) addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) if isCreature(cid) then doPlayerSendTextMessage(target, 27, "Voce ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "Voce levou ".. getCreatureName(target) .."!") end else doPlayerSendCancel(cid, "Voce") end return true end  
  13. Vodkart's post in (Resolvido)Auto Ranking Top 5 Online Broadcast was marked as the answer   
    https://tibiaking.com/forums/topic/71229-86-top-5-level-no-broadcast/
    era online kk
     
    function onThink(interval, lastExecution) local players, max = getPlayersOnline(), 5 local str = "TOP "..max.." Rank Level Online:\n\n" table.sort(players, function(a, b) return getPlayerLevel(a) > getPlayerLevel(b) end) for i = 1, max do str = str .. "\n " .. i .. " - "..getPlayerName(players[i]).."["..getPlayerLevel(players[i]).."]" end doBroadcastMessage(str, 22) return true end  
  14. Vodkart's post in (Resolvido){RESOLVIDO} Monstro virando outro com % de vida was marked as the answer   
    é pq tme mto jogador atingindo ao mesmo tempo, use assim:
     
     
    function onStatsChange(cid, attacker, type, combat, value) local stor = 354867 -- n mexa local monster = "Rabbit" -- Monstro que irá atingir o 50% e sumir local monstro = "Demon" -- Monstro que irá ser invocado local msg = "Irei sumir" -- Mensagem quando o monstro for sumir if not isMonster(cid) then return true end if type == STATSCHANGE_HEALTHLOSS and getCreatureName(cid):lower() == monster:lower() then local monsterPercent = 100/(getCreatureMaxHealth(cid)/getCreatureHealth(cid)) if monsterPercent <= 50 and monsterPercent >= 49 then if getGlobalStorageValue(stor) - os.time() <= 0 then doCreatureSay(cid, msg, 1) setGlobalStorageValue(stor, os.time() + 120) addEvent(doCreateMonster, 1000, monstro, getCreaturePosition(cid)) addEvent(doRemoveCreature, 1000, cid) end end end return true end  
  15. Vodkart's post in (Resolvido)Systema de Vip Por players e nao por Account was marked as the answer   
    eu já fiz um sistema vip por players:
     
    Query
     
    Primeiro passado execute essa query na sua DB:
     
     
    ALTER TABLE `players` ADD `vipacess` INT(15) NOT NULL DEFAULT 0;    
     
     
    Agora vá em Data/lib/050-function e adicione essas funções:
     
     
    function getCharacterAcess(cid) local query = db.getResult("SELECT `vipacess` FROM `players` WHERE `id` = "..getPlayerGUID(cid)) if query:getID() ~= -1 then return query:getDataInt("vipacess") end end function getCharacterDays(cid) local acess = math.ceil((getCharacterAcess(cid) - os.time())/(86400)) return acess <= 0 and 0 or acess end function HaveCharaterAcess(cid) return getCharacterDays(cid) > 0 and true or false end function setAcessTime(cid, time) return db.executeQuery("UPDATE `players` SET `vipacess` = "..time.." WHERE `id` = "..getPlayerGUID(cid)) end function addCharacterAcess(cid, days) local add = (days <= 0 and 1 or days)*86400 local time = getCharacterDays(cid) == 0 and (os.time() + add) or (getCharacterAcess(cid) + add) return setAcessTime(cid, time) end function doRemoveCharacterAcess(cid, days) local remove = days*86400 local time = getCharacterAcess(cid) - remove return setAcessTime(cid, (time <= 0 and 1 or time)) end function getVipAcessDate(cid) if HaveCharaterAcess(cid) then return os.date("%d/%m/%y %X", getCharacterAcess(cid)) end return false end    
     
     
     
     
    Talkactions
     
    agora em talkactions/scripts
     
     
    vipsystemplayer.lua
     
    function onSay(cid, words, param) if(words == "!buyvip") then local days = 10 local price = 50000 if not doPlayerRemoveMoney(cid, price) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar vip.") return true end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados "..days.." dias de VIP no seu character.") addCharacterAcess(cid, days) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getCharacterDays(cid).." dias de VIP, ela acaba em "..getVipAcessDate(cid)) elseif(words == "!vipdays") then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getCharacterDays(cid).." dias de VIP. "..(getCharacterDays(cid) > 0 and "ela acaba em "..getVipAcessDate(cid).."." or "")) end return true end    
     
    vipsystemgod.lua
     
    function onSay(cid, words, param) if(words == "/checkvip") then if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local player = getPlayerByName(param) if not isPlayer(player) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..player.." not found.") return true end return doPlayerPopupFYI(cid, "O jogador tem "..getCharacterDays(player).." dias de VIP no character.") elseif(words == "/addvip") then local t = string.explode(param, ",") if not tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByNameWildcard(t[1]) if(not player)then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") end addCharacterAcess(player, tonumber(t[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..tonumber(t[2]).." dias de VIP no player "..getCreatureName(player)) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..tonumber(t[2]).." dias de VIP no seu character.") elseif(words == "/delvip") then local t = string.explode(param, ",") if not tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByNameWildcard(t[1]) if(not player)then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") end doRemoveCharacterAcess(player, tonumber(t[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você removeu "..tonumber(t[2]).." dias de VIP do jogador "..getCreatureName(player)..".") end return true end    
     
     
    em talkactions.xml adicione as tags:
     
     
    <talkaction words="!buyvip;!vipdays" event="script" value="vipsystemplayer.lua"/> <talkaction words="/addvip;/delvip;/checkvip" access="4" event="script" value="vipsystemgod.lua"/>    
     
     
    Item Vip
     
    item que adiciona vip no character
     
    actions/script
     
    addvipdays.lua
     
    function onUse(cid, item, fromPosition, itemEx, toPosition) local days = 15 addCharacterAcess(cid, (days <= 0 and 1 or days)) doRemoveItem(item.uid) return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getCharacterDays(cid).." dias de VIP, ela acaba em "..getVipAcessDate(cid)) end    
     
    Actions.xml
     
    <action itemid="ID DO SEU ITEM" script="addvipdays.lua"/>    
     
     
    Vip Door
     
    actions/script
     
    perfectvipdoor.lua
     
    function onUse(cid, item, frompos, item2, topos) if not HaveCharaterAcess(cid) then return doPlayerSendTextMessage(cid,22,"Você precisa ser vip para passar aqui.") end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, topos, true) return true end    
     
    actions.xml
     
    <action actionid="7779" script="perfectvipdoor.lua"/>    
     
     
     
     Tile VIP
     
     
    em movements/scripts crie um arquivo.lua e renomeie para
     
     
    vipe.lua
     
    function onStepIn(cid, item, position, fromPosition) if item.actionid == 13700 and not HaveCharaterAcess(cid) then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"você não é vip.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"bem vindo.") return true end    
     
     
    Em movements.xml adicione a tag:
     
     
    <movevent type="StepIn" actionid="13700" event="script" value="vipe.lua"/>    
     
     
     
    no seu piso coloque ACTIONID 13700
     
     
     
    Fim Vip
     
    em creaturescript/script
     
     
    endvip.lua
     
    function onLogin(cid) if getCharacterDays(cid) > 0 then setPlayerStorageValue(cid, 9898, 1) elseif getPlayerStorageValue(cid, 9898) == 1 and getCharacterDays(cid) <= 0 then doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerPopupFYI(cid, "Sua vip Account acabou.") setPlayerStorageValue(cid, 9898, -1) end return true end    
     
    em creaturescript.xml adicione a tag:
     
     
    <event type="login" name="CheckVip" script="endvip.lua"/> --------------------------------------------------------------------------------------------------------------------
     
    só procurar no Google: Perfect Vip System 3.0
  16. Vodkart's post in (Resolvido)Double Potion que marca o Tempo was marked as the answer   
    n testei
     
    function onSay(cid, words, param) local str,c ="# INFO EXP Potions #\n\n",2 for i = 61002, 61005 do str = str.."[X"..c.."] -> "..(getPlayerStorageValue(cid, i) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, i) - os.time()).." de exp potion").."\n" c = c + 1 end return doShowTextDialog(cid, 6579, str) end  
  17. Vodkart's post in (Resolvido)Talkactions por Actions was marked as the answer   
    nao é necessario porque ele não vai ter mais a voc 10, então vai retornar uma msg dizendo que ele n tem a voc necessaria
  18. Vodkart's post in (Resolvido)[HeLP] Fly system colocar para nao usar em "X" area was marked as the answer   
    function onSay(cid, words, param) local areas ={ -- areas bloqueadas {from = {x=1014,y=1016,z=7},to = {x=1017,y=1019,z=7}}, -- começo da area e final da area {from = {x=1008,y=1018,z=7},to = {x=1011,y=1021,z=7}} } local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = true, -- se os teleport irão custa (true or false) need_level = true, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["templo"] = { -- nome do lugar pos = {x=1029, y=907, z=6},level = 150, price = 000}, ["arena"] = { -- nome do lugar pos = {x=1001, y=915, z=7},level = 150,price = 000}, } --[[ Lista de Viagem (Não mexa) ]]-- if (param == "lista") then local str = "" str = str .. "lista de viagem :\n\n" for name, pos in pairs(lugar) do str = str..name.."\n" end str = str .. "" doShowTextDialog(cid, 6579, str) return TRUE end local a = lugar[param] for _, var in ipairs(areas) do if isInRange(getCreaturePosition(cid), var.from, var.to) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você nao pode usar o comando nesta area.") return true end end if not(a) then doPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE elseif config.need_level == true and getPlayerLevel(cid) < a.level then doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".") return TRUE end  
  19. Vodkart's post in (Resolvido)Alavanca Que Teleporta 10 Players was marked as the answer   
    falha minha!
     
     
    local lvl = 12000 local entrada = { {x = 80, y = 6, z = 7}, -- pos players {x = 81, y = 6, z = 7}, {x = 82, y = 6, z = 7}, {x = 83, y = 6, z = 7}, {x = 84, y = 6, z = 7}, {x = 85, y = 6, z = 7}, {x = 86, y = 6, z = 7}, {x = 87, y = 6, z = 7}, {x = 88, y = 6, z = 7}, {x = 89, y = 6, z = 7} } local saida = {x = 1675, y = 1521, z = 7} function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} for _, k in ipairs(entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl) then doPlayerSendCancel(cid, 'esta faltando jogador ou alguem nao tem '..lvl..' ou mais.') return true end check[#check+1] = x end for _, pid in pairs(check) do doSendMagicEffect(getPlayerPosition(pid), CONST_ME_POFF) doTeleportThing(pid, saida) doSendMagicEffect(getPlayerPosition(pid), CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end  
  20. Vodkart's post in (Resolvido)[RESOLVIDO] Players vs Players was marked as the answer   
    para quem quiser o sistema, aqui está o código sem bugs de formatação do fórum:  https://pastebin.com/raw/inBHcJaL
  21. Vodkart's post in (Resolvido)[PEDIDO] effect ao passar encima do tile was marked as the answer   
    function doEffectPlayer(cid, effect, store) if not isCreature(cid) then return LUA_ERROR end if getPlayerStorageValue(cid, store) >= os.time() then doSendMagicEffect(getThingPos(cid), effect) addEvent(doEffectPlayer, 200, cid, effect, store) -- 300 é o speed do efeito pode configurar end end function onStepIn(cid, item, position, fromPosition) local efeito, seconds = 44,3 -- configure aqui o numero do efeito e tempo em segundos que vai durar o efeito local exausted, var, storage = 5, 548754, 548755 -- 5 minutos para voltar e usar o tile novamente if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, var) - os.time() <= 0 then setPlayerStorageValue(cid, storage, os.time()+seconds) doEffectPlayer(cid, efeito, storage) setPlayerStorageValue(cid, var, os.time()+exausted*60) end return true end  
  22. Vodkart's post in (Resolvido)Kill, Death, VIP, Critical, Dodge, Look. was marked as the answer   
    domodlib('task_func') LimiteQuestCount = 30 -- coloque de acordo com a quantidade de quests existente no seu servidr QuestCountSystem = 123419 -- é a storage da system, lembre-se, não deve existe outra igual function getQuestCompletCount(uid, storage) if isPlayer(uid) then if getPlayerStorageValue(uid, storage) == -1 then return 0 end return getPlayerStorageValue(uid, storage) end end function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,' [Frags: '..getPlayerFrags(thing.uid)..']['..(getPlayerStorageValue(thing.uid, 13540) - os.time() > 0 and 'VIP' or 'FREE')..'], [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48902)) or 0))..']\nQuests Completas: ['..getQuestCompletCount(thing.uid, QuestCountSystem)..'/'..LimiteQuestCount..']\n'..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is a '..GetRankTask(thing.uid)) return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,' [Frags: '..getPlayerFrags(cid)..']['..(getPlayerStorageValue(cid, 13540) - os.time() > 0 and 'VIP' or 'FREE')..'], [Critical: '..math.max(0,(tonumber(getCreatureStorage(cid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(cid,48902)) or 0))..']\nQuests Completas: ['..getQuestCompletCount(cid, QuestCountSystem)..'/'..LimiteQuestCount..']\n'..(getPlayerSex(cid) == 0 and 'She' or 'He')..' is a '..GetRankTask(cid)) local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end  
  23. Vodkart's post in (Resolvido)Check Quest Diaria was marked as the answer   
    o action do bau
     
    local t = { storage = 678678, -- storage, so mude se tiver usando pra outra coisa. tempo = 24, -- Tempo em horas. qt = 250, -- quatidade. itemidxx = 6527 -- Item que ira ganhar. } function onUse(cid, item, fromPos, itemEx, toPos) if getPlayerStorageValue(cid, t.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "Você só poderá abrir seu bau em "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,t.storage))..".") end setPlayerStorageValue(cid, t.storage, os.time() + t.tempo * 60 * 60) doPlayerSendTextMessage(cid, 25, "Voce ganhou "..t.qt.." "..t.itemidxx.." diário, espere até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,t.storage)).." para pegar novamente.") doPlayerAddItem(cid,t.itemidxx,t.qt) return true end  
     
    o tile:
     
     
    local storage = 678678 function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end return doPlayerSendTextMessage(cid, 25, getPlayerStorageValue(cid,storage) <= os.time() and "Você está apto a pegar a recompesa do báu" or "Você só poderá abrir seu bau em "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,storage))..".") end  
  24. Vodkart's post in (Resolvido)Ajuda Cave Super Up was marked as the answer   
    local function filtrateString(str) if type(str) ~= "string" then return false end local first, last = 0, 0 local second, final = 0, #str local limitedeuso = 49015 local textofinal1 = "Voce ja esta sob efeito da pot de experiencia espere o efeito acabar." for i = 1, #str do if string.byte(str:sub(i,i)) == string.byte('a') then first = i + 2 for t = first, #str do if string.byte(str:sub(t,t)) == string.byte(' ') then last = t - 1 break end end end if string.byte(str:sub(i,i)) == string.byte('b') then second = i + 2 end end return {str:sub(first, last), str:sub(second, final)} end function doPlayerHaveCave(cid) local count = 0 for i = 822081, 822098 do if tonumber(filtrateString(getGlobalStorageValue(i))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(i))[2]) - os.time() > 0 then count = count + 1 end end return count end function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 15000 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce e maior que level 15000, porem nao pode usar a cave exclusiva.") return false elseif doPlayerHaveCave(cid) > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce ja possui uma cave propria.") return false end if tonumber(filtrateString(getGlobalStorageValue(822081))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822081, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 1 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822082))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822082, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 2 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822083))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822083, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 3 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822084))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822084, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 4 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822085))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822085, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 5 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822086))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822086, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 6 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822087))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822087, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 7 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822088))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822088, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 8 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822089))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822089, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 9 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822090))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822090, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 10 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822091))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822091, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 11 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822092))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822092, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 12 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822093))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822093, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 13 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822094))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822094, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 14 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822095))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822095, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 15 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822096))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822096, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 16 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822097))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822097, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 17 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822098))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822098, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 18 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) else doPlayerSendCancel(cid, "Todas as caves já estão com dono no momento. Tente mais tarde.") end return true end  
    tenta assim
  25. Vodkart's post in (Resolvido)ajuda error script tp was marked as the answer   
    o problema está na estruturação do código.
     
    function onStepIn(cid, item, position, fromPosition) local pos = {x=397, y=1056, z=7} if getPlayerStorageValue(cid, 8000) == 112 then setPlayerStorageValue(cid, 8000, 113) doPlayerAddExperience(cid, 10000) elseif getPlayerStorageValue(cid, 8000) == 114 then doTeleportThing(cid, pos) end return true end  

Informação Importante

Confirmação de Termo