Postado Junho 5, 2021 4 anos .Qual servidor ou website você utiliza como base? Qual o motivo deste tópico? Então galera esse e meu primeiro tópico aqui, não sei se estou postando certo desculpem qualquer coisa. Mudei meu tfs 0.4 para 1.2 e estou refazendo tudo aqui mas não estou conseguindo fazer esse script e um talkactions que teletransporta o player para posições no mapa por comando /ir. Funcionar no tfs 1.2 se alguém puder me ajudar agradeço muito mesmo. Está surgindo algum erro? Se sim coloque-o aqui. Citar Você tem o código disponível? Se tiver publique-o aqui: function onSay(cid, words, param) 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 = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } local STORAGE_JAIL = 50026 --[[ Config lugares]]-- local lugar = { ["formorgar2"] = { -- nome do lugar pos = {x=2094, y=136, z=8},level = 1,price = 0, premium = 1}, ["wyrm"] = { -- nome do lugar pos = {x=528, y=1529, z=7},level = 1,price = 0, premium = 1}, ["erech"] = { -- nome do lugar pos = {x=1070, y=1250, z=5},level = 1,price = 0, premium = 1}, ["veglon"] = { -- nome do lugar pos = {x=228, y=449, z=7},level = 1,price = 0, premium = 1}, } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = getPlayerStorageValue(cid, STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true else setPlayerStorageValue(cid, STORAGE_IR, os.time()) end if not(a) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "As cidades que voce pode ir sao: edoras, belfallas, ashenport, bree, riv, dol, esg, argond, moria, mordor, forod, condado, dunedain, anfallas, minas.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Lugares onde Apenas VIPS podem ir:") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Até Level 30: promoOrc, troll1, troll2, rot, pirata, mino1, mino2, pantano, eriador, dwarf1, dwarf2, macacos1, macacos2, slime1, slime2, slime3, ghoul, bandit1, bandit2, cyc1, cyc2, cyc3, stonegolem, dworc1, eregion.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "De level 31 a 100: rhun, dragonvip, erebor, mirkwood, forochel, carn, enedwaith, elven, elven2, wyvern, corsario, dunland, icedunland, beleghost, evendim, bonebeast1, bonebeast2, orc, blacknight1, blacknight2, hero1, hero2, hero3, hydra1, hydra2, hydra3, lich, icewitch1, icewitch2, crystal, barbarian, dragon1, dragon2, vamp, turtle, purga, quara.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Level maior que 100: erech, formorgar, formorgar2, wyrm, veglon, northern, ered, orodruin, ice, nimrais, defiler, behedemon, harlond, northern2.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") return TRUE elseif getPlayerStorageValue(cid, STORAGE_JAIL) > os.time() then doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", getPlayerStorageValue(cid, STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end if a.premium == 1 and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return TRUE else if getPlayerGroupId(cid) >= 3 then doTeleportThing(cid, a.pos) else doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, a.pos) doSendMagicEffect(getPlayerPosition(cid),40) end end return TRUE end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. Editado Junho 5, 2021 4 anos por jhonathan wendrell (veja o histórico de edições)
Postado Junho 6, 2021 4 anos Solução @jhonathan wendrell Boa noite, <talkaction words="/ir" separator=" " script="NOME_DO_ARQUIVO.lua" /> function onSay(player, words, param) local STORAGE_JAIL = 50026 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 = false, -- se os teleport irão custa (true or false) need_level = false, -- 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 = { ["formorgar2"] = { pos = {x=2094, y=136, z=8},level = 1,price = 0, premium = 1}, ["wyrm"] = { pos = {x=528, y=1529, z=7},level = 1,price = 0, premium = 1}, ["erech"] = { pos = {x=1070, y=1250, z=5},level = 1,price = 0, premium = 1}, ["veglon"] = { pos = {x=228, y=449, z=7},level = 1,price = 0, premium = 1}, } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = player:getStorageValue(STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true end player:setStorageValue(STORAGE_IR, os.time()) if not(a) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "As cidades que voce pode ir sao: edoras, belfallas, ashenport, bree, riv, dol, esg, argond, moria, mordor, forod, condado, dunedain, anfallas, minas.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Lugares onde Apenas VIPS podem ir:") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Até Level 30: promoOrc, troll1, troll2, rot, pirata, mino1, mino2, pantano, eriador, dwarf1, dwarf2, macacos1, macacos2, slime1, slime2, slime3, ghoul, bandit1, bandit2, cyc1, cyc2, cyc3, stonegolem, dworc1, eregion.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "De level 31 a 100: rhun, dragonvip, erebor, mirkwood, forochel, carn, enedwaith, elven, elven2, wyvern, corsario, dunland, icedunland, beleghost, evendim, bonebeast1, bonebeast2, orc, blacknight1, blacknight2, hero1, hero2, hero3, hydra1, hydra2, hydra3, lich, icewitch1, icewitch2, crystal, barbarian, dragon1, dragon2, vamp, turtle, purga, quara.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Level maior que 100: erech, formorgar, formorgar2, wyrm, veglon, northern, ered, orodruin, ice, nimrais, defiler, behedemon, harlond, northern2.") return true end if (config.premium == true and player:getPremiumDays() <= 0) then player:sendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") end if (player:getStorageValue(STORAGE_JAIL) > os.time()) then player:sendTextMessage(MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", player:getStorageValue(STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return true end if (config.battle == true and player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) ~= nil) then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return true end if a.premium == 1 and player:getPremiumDays() <= 0 then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return true end local pos = Position(a.pos.x, a.pos.y, a.pos.z) if player:getGroup():getId() >= 3 then player:teleportTo(pos) return true end player:getPosition():sendMagicEffect(27) player:teleportTo(pos) player:getPosition():sendMagicEffect(40) return true end
Postado Junho 6, 2021 4 anos Autor 20 horas atrás, MatteusDeli disse: @jhonathan wendrell Boa noite, <talkaction words="/ir" separator=" " script="NOME_DO_ARQUIVO.lua" /> function onSay(player, words, param) local STORAGE_JAIL = 50026 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 = false, -- se os teleport irão custa (true or false) need_level = false, -- 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 = { ["formorgar2"] = { pos = {x=2094, y=136, z=8},level = 1,price = 0, premium = 1}, ["wyrm"] = { pos = {x=528, y=1529, z=7},level = 1,price = 0, premium = 1}, ["erech"] = { pos = {x=1070, y=1250, z=5},level = 1,price = 0, premium = 1}, ["veglon"] = { pos = {x=228, y=449, z=7},level = 1,price = 0, premium = 1}, } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = player:getStorageValue(STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true end player:setStorageValue(STORAGE_IR, os.time()) if not(a) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "As cidades que voce pode ir sao: edoras, belfallas, ashenport, bree, riv, dol, esg, argond, moria, mordor, forod, condado, dunedain, anfallas, minas.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Lugares onde Apenas VIPS podem ir:") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Até Level 30: promoOrc, troll1, troll2, rot, pirata, mino1, mino2, pantano, eriador, dwarf1, dwarf2, macacos1, macacos2, slime1, slime2, slime3, ghoul, bandit1, bandit2, cyc1, cyc2, cyc3, stonegolem, dworc1, eregion.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "De level 31 a 100: rhun, dragonvip, erebor, mirkwood, forochel, carn, enedwaith, elven, elven2, wyvern, corsario, dunland, icedunland, beleghost, evendim, bonebeast1, bonebeast2, orc, blacknight1, blacknight2, hero1, hero2, hero3, hydra1, hydra2, hydra3, lich, icewitch1, icewitch2, crystal, barbarian, dragon1, dragon2, vamp, turtle, purga, quara.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Level maior que 100: erech, formorgar, formorgar2, wyrm, veglon, northern, ered, orodruin, ice, nimrais, defiler, behedemon, harlond, northern2.") return true end if (config.premium == true and player:getPremiumDays() <= 0) then player:sendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") end if (player:getStorageValue(STORAGE_JAIL) > os.time()) then player:sendTextMessage(MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", player:getStorageValue(STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return true end if (config.battle == true and player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) ~= nil) then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return true end if a.premium == 1 and player:getPremiumDays() <= 0 then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return true end local pos = Position(a.pos.x, a.pos.y, a.pos.z) if player:getGroup():getId() >= 3 then player:teleportTo(pos) return true end player:getPosition():sendMagicEffect(27) player:teleportTo(pos) player:getPosition():sendMagicEffect(40) return true end muito obrigado mesmo amigo funcionou aqui vlw Editado Junho 6, 2021 4 anos por jhonathan wendrell (veja o histórico de edições)
Postado Junho 6, 2021 4 anos @jhonathan wendrell Então, você usou o comando sendo GOD? Se sim, o efeito não vai ser disparado, agora se você usou sendo player mesmo acredito que irá funcionar. Caso não funcione tem que ver se a sua source possui a função: sendMagicEffect
Postado Junho 7, 2021 4 anos Autor 35 minutos atrás, MatteusDeli disse: @jhonathan wendrell Então, você usou o comando sendo GOD? Se sim, o efeito não vai ser disparado, agora se você usou sendo player mesmo acredito que irá funcionar. Caso não funcione tem que ver se a sua source possui a função: sendMagicEffect foi isso mesmo mas como player nao tava dando efeito na posiçao anterior do player como nao sei fazer script e nao manjo quase nada de lua, mas nao sou besta fui num script aqui teleport_to_pos copiei local tmp = player:getPosition() if player:teleportTo(pos) and not player:isInGhostMode() then tmp:sendMagicEffect(28) pos:sendMagicEffect(73) end return false adcionei os efeito que eu queria colei la no lugar e ficou top kk vlw ai mano, se eu precisar mudar algum outro script eu posso postar aqui ou fazer outro topico nao querendo abusar tem 3 meses que estou montando esse ot era 8.60 tfs 0.4 passei para 10x tfs 1.2 com sprites de client 12.64. Fiz e aprendi muita coisa nesse tempo so olhando os foruns mas tem hora que preciso pedir ajuda. Desculpe qualquer coisa esse e meu primeiro topico.
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.