Postado Dezembro 24, 2016 8 anos Autor Em 24/12/2016 em 03:04, Ed.Specter disse: tem que mudar tudo ai no script pra rodar em 1.2 local pos = { [1] = {playerpos = {x = 1211, y = 1162, z = 6}, nplayerpos = {x=1211, y=1162, z=7}}, [2] = {playerpos = {x = 1210, y = 1162, z = 6}, nplayerpos = {x=1210, y=1162, z=7}}, [3] = {playerpos = {x = 1209, y = 1162, z = 6}, nplayerpos = {x=1209, y=1162, z=7}}, [4] = {playerpos = {x = 1207, y = 1162, z = 6}, nplayerpos = {x=1208, y=1162, z=7}} } local questLevel = 100 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.uid == 7000 then if item.itemid == 1946 then for _, pid in pairs(pos) do local topPlayer = Tile(pid.playerpos):getTopCreature() if topPlayer:isPlayer() then if topPlayer:getLevel() >= questLevel then pid.playerpos:sendMagicEffect(2) topPlayer:teleportTo(pid.nplayerpos) pid.nplayerpos:sendMagicEffect(2) else topPlayer:sendTextMessage(MESSAGE_STATUS_SMALL,"Você precisa estar no level "..questLevel.."+.") end item:transform(1945) end end elseif item.itemid == 1945 then item:transform(1946) end end end tenta assim..@PedroSTT funções : http://pastebin.com/wrnD8jHH Sim , msm eu não mechendo em TFS 1.2 , ele devia criar um topico no forum e pedir ajuda , o assunto desde topico não é suporte em relação a scripts , e sim pedido de scripts.
Postado Dezembro 24, 2016 8 anos Em 24/12/2016 em 03:04, Ed.Specter disse: tem que mudar tudo ai no script pra rodar em 1.2 local pos = { [1] = {playerpos = {x = 1211, y = 1162, z = 6}, nplayerpos = {x=1211, y=1162, z=7}}, [2] = {playerpos = {x = 1210, y = 1162, z = 6}, nplayerpos = {x=1210, y=1162, z=7}}, [3] = {playerpos = {x = 1209, y = 1162, z = 6}, nplayerpos = {x=1209, y=1162, z=7}}, [4] = {playerpos = {x = 1207, y = 1162, z = 6}, nplayerpos = {x=1208, y=1162, z=7}} } local questLevel = 100 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.uid == 7000 then if item.itemid == 1946 then for _, pid in pairs(pos) do local topPlayer = Tile(pid.playerpos):getTopCreature() if topPlayer:isPlayer() then if topPlayer:getLevel() >= questLevel then pid.playerpos:sendMagicEffect(2) topPlayer:teleportTo(pid.nplayerpos) pid.nplayerpos:sendMagicEffect(2) else topPlayer:sendTextMessage(MESSAGE_STATUS_SMALL,"Você precisa estar no level "..questLevel.."+.") end item:transform(1945) end end elseif item.itemid == 1945 then item:transform(1946) end end end tenta assim..@PedroSTT funções : http://pastebin.com/wrnD8jHH testei esse script ai e deu esse erro aqui Mostrar conteúdo oculto Lua Script Error: [Action Interface] data/actions/scripts/quests/annihi.lua:onUse data/actions/scripts/quests/annihi.lua:14: attempt to index local 'topPlayer' (a nil value) stack traceback: [C]: in function '__index' data/actions/scripts/quests/annihi.lua:14: in function <data/actions/scripts/quests/annihi.lua:9>
Postado Dezembro 24, 2016 8 anos Em 22/12/2016 em 15:17, Ocruxzika disse: Preciso de ajuda no script, ot war, para quando alguem matar Mc perder level e não ganha dinheiro!. Aproveitando a deixa queria que me ajudasse a aumentar a diferença de level dos players para ganhar xp na war. exemplo: player level 200 so ganha xp matando players até lvl 300, diferença de 100 levels. desde ja obrigado! vo deixar minha deathBroadcast.lua Mostrar conteúdo oculto Mostrar conteúdo oculto local config = { affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for? killStorageValue = 3943, deathStorageValue = 3944, -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME rewardItem = { use = true, itemid = 2152, minLevel = false, -- false if you don't want any level req minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed). }, killerAnimation = { use = true, text = "Frag!", -- Only 9 letters! No "commands" here. color = 144 }, targetAnimation = { use = true, text = "Owned!", -- Only 9 letters! No "commands" here. color = 180 } } function onDeath(cid, corpse, deathList) for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do local killer = deathList if(isPlayer(killer) == TRUE) then local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1 local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1 local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1 local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1 setPlayerStorageValue(killer, config.killStorageValue, targetKills) setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths) local killerLevel = getPlayerLevel(killer) local targetLevel = getPlayerLevel(cid) local levelDiff = targetLevel - killerLevel local values = { ["KILLERKILLS"] = killerKills, ["KILLERDEATHS"] = killerDeaths, ["KILLERNAME"] = getCreatureName(killer), ["KILLERLEVEL"] = killerLevel, ["TARGETKILLS"] = targetKills, ["TARGETDEATHS"] = targetDeaths, ["TARGETNAME"] = getCreatureName(cid), ["TARGETLEVEL"] = targetLevel } function formateString(str) return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end))) end if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 5) end if(config.killerAnimation.use) then doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color) end if(config.targetAnimation.use) then doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color) end end end return trueend Tbm Estou querendo um script assim.
Postado Dezembro 24, 2016 8 anos opa tudo bem ? entao eu estou com um problema no meu npc ele deveria vender aol,bless e premium, mas eu tentei arrumar, só que agr bugou de vez ele nem aparece e nao responde mais Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, "premium") or msgcontains(msg, "price")) then selfSay("O valor do premium atualmente esta 300K por 5 dais.", cid) elseif(msgcontains(msg, "premium") or msgcontains(msg, "Premium")) then selfSay("Você gostaria de comprar 5 dias de premium?", cid) talkState[talkUser] = 1 elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1) then if(doPlayerRemoveItem(cid, 2160, 30) == true) then selfSay("Muito bem! Aproveite!", cid) doPlayerAddPremiumDays(cid, 5) talkState[talkUser] = 1 elseif(doPlayerRemoveItem(cid, 2152, 200) == true) then selfSay("Muito bem! Aproveite!", cid) doPlayerAddPremiumDays(cid, 5) talkState[talkUser] = 1 elseif(doPlayerRemoveItem(cid, 2148, 20000) == true) then selfSay("Muito bem! Aproveite!", cid) doPlayerAddPremiumDays(cid, 5) talkState[talkUser] = 1 else selfSay("Desculpe, você não tem o {valor} necessário parar comprar uma premium.", cid) talkState[talkUser] = 1 end end return TRUE end local node1 = keywordHandler:addKeyword({"first bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the first blessing for 2000 (plus level depending amount) gold?"}) node1:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node1:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node2 = keywordHandler:addKeyword({"second bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the second blessing for 2000 (plus level depending amount) gold?"}) node2:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node2:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node3 = keywordHandler:addKeyword({"third bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the third blessing for 2000 (plus level depending amount) gold?"}) node3:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node3:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node4 = keywordHandler:addKeyword({"fourth bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?"}) node4:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node4:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node5 = keywordHandler:addKeyword({"fifth bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?"}) node5:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 200000, levelCost = 666, startLevel = 60, endLevel = 200}) node5:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) if msgcontains(msg, "all") then havebless = {} b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end for i = 1, 5 do if(getPlayerBlessing(cid, i)) then table.insert(havebless,i) end end b_price = ((5 - #havebless) * b_price) if b_price == 0 then selfSay('You already have all available blessings.',cid) talkState[talkUser] = 0 return true end selfSay('Do you want to receive all blessings for ' .. b_price .. ' gold?',cid) talkState[talkUser] = 96 return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Templarium Taboos" script="Templarium.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="268" head="255" body="94" legs="255" feet="0" addons="3"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Fale {trade} para ver minhas ofertas, {bless} para compra bless somente acima do level {60}, {premium} para compra 5 dia de premium account." /> <parameter key="message_decline" value="Adeus, |PLAYER NAME|." /> <parameter key="message_walkaway" value="Adeus, |PLAYER NAME|." /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="bless;premium;" /> <parameter key="keyword_reply1" value="{first bless},{second bless},{third bless},{third bless},{fifth bless} or {all}" /> <parameter key="keyword_reply2" value="O valor de 5 days premium esta custando atualmente 300k, ira querer ?" /> <parameter key="shop_buyable" value="Amulet of Loss,2173,200000;"/> </parameters> </npc> se possivel me ajude urgente !!! obrigadao desde jah OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!
Postado Dezembro 24, 2016 8 anos Autor Em 24/12/2016 em 19:01, kinglekke disse: opa tudo bem ? entao eu estou com um problema no meu npc ele deveria vender aol,bless e premium, mas eu tentei arrumar, só que agr bugou de vez ele nem aparece e nao responde mais Mostrar conteúdo oculto Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, "premium") or msgcontains(msg, "price")) then selfSay("O valor do premium atualmente esta 300K por 5 dais.", cid) elseif(msgcontains(msg, "premium") or msgcontains(msg, "Premium")) then selfSay("Você gostaria de comprar 5 dias de premium?", cid) talkState[talkUser] = 1 elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1) then if(doPlayerRemoveItem(cid, 2160, 30) == true) then selfSay("Muito bem! Aproveite!", cid) doPlayerAddPremiumDays(cid, 5) talkState[talkUser] = 1 elseif(doPlayerRemoveItem(cid, 2152, 200) == true) then selfSay("Muito bem! Aproveite!", cid) doPlayerAddPremiumDays(cid, 5) talkState[talkUser] = 1 elseif(doPlayerRemoveItem(cid, 2148, 20000) == true) then selfSay("Muito bem! Aproveite!", cid) doPlayerAddPremiumDays(cid, 5) talkState[talkUser] = 1 else selfSay("Desculpe, você não tem o {valor} necessário parar comprar uma premium.", cid) talkState[talkUser] = 1 end end return TRUE end local node1 = keywordHandler:addKeyword({"first bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the first blessing for 2000 (plus level depending amount) gold?"}) node1:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node1:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node2 = keywordHandler:addKeyword({"second bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the second blessing for 2000 (plus level depending amount) gold?"}) node2:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node2:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node3 = keywordHandler:addKeyword({"third bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the third blessing for 2000 (plus level depending amount) gold?"}) node3:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node3:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node4 = keywordHandler:addKeyword({"fourth bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?"}) node4:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200}) node4:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) local node5 = keywordHandler:addKeyword({"fifth bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?"}) node5:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 200000, levelCost = 666, startLevel = 60, endLevel = 200}) node5:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"}) if msgcontains(msg, "all") then havebless = {} b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end for i = 1, 5 do if(getPlayerBlessing(cid, i)) then table.insert(havebless,i) end end b_price = ((5 - #havebless) * b_price) if b_price == 0 then selfSay('You already have all available blessings.',cid) talkState[talkUser] = 0 return true end selfSay('Do you want to receive all blessings for ' .. b_price .. ' gold?',cid) talkState[talkUser] = 96 return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Mostrar conteúdo oculto Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Templarium Taboos" script="Templarium.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="268" head="255" body="94" legs="255" feet="0" addons="3"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Fale {trade} para ver minhas ofertas, {bless} para compra bless somente acima do level {60}, {premium} para compra 5 dia de premium account." /> <parameter key="message_decline" value="Adeus, |PLAYER NAME|." /> <parameter key="message_walkaway" value="Adeus, |PLAYER NAME|." /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="bless;premium;" /> <parameter key="keyword_reply1" value="{first bless},{second bless},{third bless},{third bless},{fifth bless} or {all}" /> <parameter key="keyword_reply2" value="O valor de 5 days premium esta custando atualmente 300k, ira querer ?" /> <parameter key="shop_buyable" value="Amulet of Loss,2173,200000;"/> </parameters> </npc> se possivel me ajude urgente !!! obrigadao desde jah Não consegui identificar o erro , você quer que eu faça um proprio NPC para você ?
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.