Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. viu vc nao copiou, olha como está o outro script: local tpId = 1387 local pos, topos = {x=151, y=40, z=7},{x=95, y=182, z=7} function onSay(cid,words,param,channel) local t = getTileItemById(pos, tpId).uid if param == "close" then if t > 0 then doRemoveItem(t) doSendMagicEffect(pos, CONST_ME_POFF) doBroadcastMessage("O teleporte foi fechado!") else doPlayerSendCancel(cid, "Desculpe, mas nao tem nenhum teleport no momento.") end return true end if t > 0 then doPlayerSendCancel(cid, "Desculpe, ja existe um telepor criado no momento.") return true end doCreateTeleport(tpId, topos, pos) doBroadcastMessage("O teleporte foi aberto!") return true end está diferente.
  2. @mullino Então você não copiou meu script que editei ali em cima, testei aqui e funcionou:
  3. @mullino usa o ultimo script que editei ali em cima e testa fazendo o favor.
  4. @mullino local tpId = 1387 local pos, topos = {x=151, y=40, z=7},{x=95, y=182, z=7} function onSay(cid,words,param,channel) local t = getTileItemById(pos, tpId).uid if param == "close" then if t > 0 then doRemoveItem(t) doSendMagicEffect(pos, CONST_ME_POFF) doBroadcastMessage("O teleporte foi fechado!") else doPlayerSendCancel(cid, "Desculpe, mas nao tem nenhum teleport no momento.") end return true end if t > 0 then doPlayerSendCancel(cid, "Desculpe, ja existe um telepor criado no momento.") return true end doCreateTeleport(tpId, topos, pos) doBroadcastMessage("O teleporte foi aberto!") return true end vc está colocando algum item embaixo do teleport? porque o tile tem que estar "limpo", sem aquelas bolinhas verdes embaixo sabe rs ##EDITADO## estava usando base do tfs 0.3.8 mas vi que vc usa outra versão por iso não iria... KKKKK valeu @mullino editei o ultimo script agora
  5. tag <talkaction words="/dice" access="5" script="nome do seu script.lua"/>
  6. rewmonster.lua function GiveRewards(cid, items) -- n mexa na função local backpack,str = doPlayerAddItem(cid, 1999, 1), '' -- backpackID for i = 1, table.maxn(items) do local chance, itemid, amount = items[i].chance, items[i].itemid,items[i].amount if chance > math.random(1, 100) then if isItemStackable(itemid) or amount == 1 then doAddContainerItem(backpack, itemid, amount) else for i = 1, amount do doAddContainerItem(backpack, itemid, 1) end end str = str .. amount .. ' ' .. getItemNameById(itemid) str = i ~= table.maxn(items) and str .. ', ' or str .. '.' end end return str end local monstName = "Pythius The Rotten" -- nome do monstro local rewards = { -- chance, itemid e quantidade {chance = 50, itemid = 2173, amount = 1}, {chance = 10, itemid = 2494, amount = 1}, {chance = 100, itemid = 2159,amount = 20}, {chance = 100, itemid = 2160, amount = 100} } function onDeath(cid, corpse, killer) if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then local t = getSpectators(getCreaturePosition(cid), 7, 5, false) -- quem vai estar a 7x5 sqm dele vai ganhar os itens. pode aumentar o radius. if t then for _, pid in ipairs(t) do if isPlayer(pid) then local r = GiveRewards(pid, rewards) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE,"Parabéns, Você destriu o monstro "..monstName..". Suas recompensas: "..r) end end end end return true end em creaturescript.xml adicione a tag: <event type="death" name="RewaMonster" event="script" value="rewmonster.lua"/> No arquivo Xml do seu monstro adicione <script> <event name="RewaMonster"/> </script>
  7. @Tomarasdaf kk tenta trocar esse 10000 que coloquei e coloca so uns 500 pra ver, não conheço mto a função sacas? local add = 10000 -- 10 segundos tenta colocar por exemplo local add = 500 -- ou tenta colocar local add = 50 -- e vai testando
  8. @Tomarasdaf ja arrumei, ali no globalevents o interval é na tag, eu coloquei 5 de interval na tag e a cada 5 segundos vai subir 500(meio segundo) a cada 1000 = 1 segundo você pode colocar ali por exemplo 10 segundos de stamina a cada 5 segundos function onThink(pid, interval, lastExecution, thinkInterval) local refuel = 42 * 60 * 1000 -- full local add = 10000 -- 10 segundos for _, pid in ipairs(getPlayersOnline()) do if getTilePzInfo(getCreaturePosition(pid)) and getPlayerStamina(pid) < refuel then doPlayerSetStamina(pid, getPlayerStamina(pid) + add) end end return true end
  9. function onCastSpell(cid, var) local jogadorpos = getCreaturePosition(cid) local target = getCreatureTarget(cid) local monsterpos = getCreaturePosition(target) if target and isPlayer(target) then doTeleportThing(cid,monsterpos) doTeleportThing(target,jogadorpos) doSendMagicEffect(jogadorpos, 65) doSendMagicEffect(monsterpos, 65) else doPlayerSendTextMessage(cid,20,'It is not possible to use on creatures.') end return true end
  10. sera que fazendo pelo onThink nao é melhor? exemplo no creaturescript: staminareco.lua local storage = 323274 local store,exausted = 156892,30 function onLogin(cid) registerCreatureEvent(cid, "StaminaThink") setPlayerStorageValue(cid, store,0) setPlayerStorageValue(cid, storage, 0) return true end function onThink(cid, interval) if not isPlayer(cid) or not isCreature(cid) then return true end if getTilePzInfo(getCreaturePosition(cid)) and getPlayerStorageValue(cid, storage) <= 0 then setPlayerStorageValue(cid, storage, 1) if getPlayerStorageValue(cid, store) - os.time() <= 0 then doPlayerSendTextMessage(cid, 20, "{Stamina Recovery} Sua stamina começou a se recuperar, o fator de recuperação é de 30 segundos de stamina a cada 5 segundos dentro da zona de proteção em relação as condições normais.") setPlayerStorageValue(cid, store, os.time()+exausted) end elseif not getTilePzInfo(getCreaturePosition(cid)) and getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, 0) end return true end TAG <event type="login" name="StaminareLogin" event="script" value="staminareco.lua"/> <event type="think" name="StaminaThink" event="script" value="staminareco.lua"/> e no globalevents: staminareco.lua function onThink(pid, interval, lastExecution, thinkInterval) local refuel = 42 * 60 * 1000 -- full local add = 30000 -- 30 segundos for _, pid in ipairs(getPlayersOnline()) do if getTilePzInfo(getCreaturePosition(pid)) and getPlayerStamina(pid) < refuel then doPlayerSetStamina(pid, getPlayerStamina(pid) + add) end end return true end TAG <globalevent name="StaminaRegen" interval="5" script="staminareco.lua"/> obs: se o seu servidor for em milesegundos trocar o "5" por "5000"
  11. @BilauX function onSay(cid, words, param, channel) local split = param:explode(",") local name, count = split[1], tonumber(split[2]) local pid = getPlayerByNameWildcard(name) if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Player " .. param .. " is not currently online.") return TRUE end if not(split[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The commands requires 2 parameters: character name, amount") end if not(count) then print(count) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Numeric parameter required.") end doPlayerAddotfunPoints(pid, count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, count .. " otfun points were added to " .. name .. "\'s Account.") doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recived "..count.." otfun points!") return true end
  12. vc pode direcionar a pos do teleport dependendo do actionID do que piso onde ele passar, exemplo: AID 30501 --> POS 256,65,7 AID 30502 --> POS 587,72,5 etc...
  13. o que seria 0.5? 30 segundos de stamina?
  14. o certo é 'pid' e nao 'cid' doPlayerAddotfunPoints(pid, count)
  15. @Matheuus local min_group_id = 1 -- aqui vai contar a partir do 2, 3, 4 ... function onSay(cid, words, param, channel) local query, str = db.getResult("SELECT `name`, `group_id` FROM `players` WHERE `group_id` > "..min_group_id), "--> STAFF <--\n\n[Group]Nick | Status\n" if (query:getID() ~= -1) then repeat local _ = query:getDataString("name") local target_online = getPlayerByNameWildcard(_) if (not target_online or (isPlayerGhost(target_online) and getPlayerGhostAccess(target_online) > getPlayerGhostAccess(cid))) then status = "Offline" else status = "Online" end str = str .. "\n ["..getGroupInfo(query:getDataInt("group_id")).name.."]".._.." | "..status until not(query:next()) query:free() end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end
  16. O certo seria refazer esse script feioso kkk mas to sem tempo local displayoutput = {"Resets","Level","Magic Level","Fist Fighting","Club Fighting","Sword Fighting","Axe Fighting","Distance Fighting","Shielding"} local itemtype = {9969,9933,5896,8929,8932,7388,8849,8906,2580} local storage = 378378 -- valor da storage function onSay(cid, words, param) number = 1 param = string.lower(param) skilllist = "" command = TRUE if param == "reset" then display = 1 elseif param == "level" then display = 2 elseif param == "magic" then id = 1 display = 3 elseif param == "club" then id = 2 display = 4 elseif param == "sword" then id = 3 display = 5 elseif param == "axe" then id = 4 display = 6 elseif param == "distance" then id = 5 display = 7 elseif param == "shield" then id = 6 display = 8 else error = 'Highscore Commands:\n\n!rank reset\n!rank level\n!rank magic\n!rank fist\n!rank club\n!rank sword\n!rank axe\n!rank distance\n!rank shield\n' doShowTextDialog(cid, 5958, error) command = FALSE end if command ~= FALSE then if display == 1 then local player = db.getResult("SELECT `name`, `reset` FROM `players` WHERE group_id < '2' ORDER BY `reset` DESC LIMIT 50;") if(player:getID() ~= -1) then while (true) do local name = player:getDataString("name") local level = player:getDataInt("reset") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..level) number = number + 1 if not(player:next()) then break end end player:free() end elseif display == 2 then local player = db.getResult("SELECT `name`, `level` FROM `players` WHERE group_id < '2' ORDER BY `level` DESC LIMIT 50;") if(player:getID() ~= -1) then while (true) do local name = player:getDataString("name") local level = player:getDataInt("level") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..level) number = number + 1 if not(player:next()) then break end end player:free() end elseif display == 3 then local player = db.getResult("SELECT `name`, `maglevel` FROM `players` WHERE group_id < '2' ORDER BY `maglevel` DESC LIMIT 50;") if(player:getID() ~= -1) then while (true) do local name = player:getDataString("name") local maglevel = player:getDataInt("maglevel") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..maglevel) if not(player:next()) then break end number = number + 1 end end player:free() else local skills = db.getResult("SELECT `player_id`, `value`, `skillid` FROM `player_skills` WHERE `skillid` = "..id.." ORDER BY `value` DESC;") while (true) do local GUID = skills:getDataInt("player_id") local value = skills:getDataInt("value") local skillid = skills:getDataInt("skillid") local player = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..GUID.." and group_id < '2' ") if(player:getID() ~= -1) then local name = player:getDataString("name") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..value) number = number + 1 player:free() end if number > 50 then break end if not(skills:next()) then break end end skills:free() end dialog = ""..displayoutput[display].." Highscores: \n "..skilllist.."" doShowTextDialog(cid, itemtype[display], dialog) end end
  17. @Matheuus Primeiro me da a bunda e trato feito
  18. @Matheuus local min_group_id = 1 -- aqui vai contar a partir do 2, 3, 4 ... function onSay(cid, words, param, channel) local query, str = db.getResult("SELECT `name`, `group_id` FROM `players` WHERE `group_id` > "..min_group_id), "--> STAFF <--\n\n[Group]Nick | Status\n" if (query:getID() ~= -1) then repeat local _ = query:getDataString("name") local target_online = getPlayerByNameWildcard(_) str = str .. "\n ["..getGroupInfo(query:getDataInt("group_id")).name.."]".._.." | "..(isPlayerGhost(target_online) or not isPlayer(target_online) and "Offline" or "Online") until not(query:next()) query:free() end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end
  19. qual a versão? 8.6 ou tfs 1.2+?
  20. posta o script que vc esta usando
  21. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  22. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  23. function onUse(cid,item,frompos,topos) local const = 3000 local itemid = 2197 local qtd = 5 local player = Player(cid) local freecap = player:getFreeCapacity() if player:getFreeCapacity() < (ItemType(itemid):getWeight(qtd) + ItemType(2003):getWeight()) then return player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have enough cap.') elseif not player:removeMoney(const) then return player:sendCancelMessage("You don't have enough money.") end local bp = doPlayerAddItem(cid, 2003, 1, false) for i = 1, 20 do doAddContainerItem(bp, itemid, qtd) end doPlayerSendTextMessage(cid,22,'It selling.') return true end
  24. @Storm Só uma correção, geralmente as funções 'get' 'set' começam com letras minusculas, por exemplo setGlobalStorageValue getGlobalStorageValue getTileThingByPos getTileInfo getPlayerStorageValue getPlayerLevel setPlayerStorageValue

Informação Importante

Confirmação de Termo