Wend ll 268 Postado Maio 25, 2015 Share Postado Maio 25, 2015 Hi. Outro pedido de um user, fiz esse script há um bom tempo. É um script de pistola. Você equipa em uma das mãos, usa a arma em algum monster ou player e boa, atira. Script: data/actions/scripts/pistol.lua: local need_target = true -- Precisa de target? (true / false) Se false, o sistema utilizará o Use With. local bullet_id = 2544 -- ID da munição local shots_amount = 1 -- Tiros por vez local exhaustion_time = 1 -- Segundos de exhaustion local exhaust = 19301 -- Storage da exhaustion local dmg_min, dmg_max = -10, -20 -- Dano mínimo, dano máximo local shot_effect = 3 -- Efeito do tiro local shot_distance_effect = 1 -- Distance effect do tiro local damage_type = COMBAT_PHYSICALDAMAGE -- Tipo de dano local shots_delay = 200 -- Delay dos tiros (em milissegundos) local slots = {CONST_SLOT_LEFT, CONST_SLOT_RIGHT} -- Constants dos Slots permitidos local control = 0 -- Não modifique, variável de controle function onUse(cid, item, fromPosition, itemEx, toPosition) for a, b in ipairs(slots) do if getPlayerSlotItem(cid, b).uid ~= item.uid then control = control + 1 end end if control == slots then return doPlayerSendCancel(cid, "Coloque a arma no slot correto.") end if need_target then if getCreatureTarget(cid) <= 0 then return doPlayerSendCancel(cid, "Selecione um alvo primeiro.") elseif getPlayerItemCount(cid, bullet_id) < shots_amount then return doPlayerSendCancel(cid, "Você não possui munição.") elseif exhaustion.check(cid, exhaust) then return doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, exhaust)).." segundos para usar a arma novamente.") end exhaustion.set(cid, exhaust, exhaustion_time) for i = 0, shots_amount-1 do addEvent(function() if getCreatureTarget(cid) <= 0 then return true elseif getPlayerItemCount(cid, bullet_id) < 1 then return doPlayerSendCancel(cid, "Você não possui munição.") end doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(getCreatureTarget(cid)), shot_distance_effect) doTargetCombatHealth(cid, getCreatureTarget(cid), damage_type, dmg_min, dmg_max, shot_effect) doPlayerRemoveItem(cid, bullet_id, 1) end, shots_delay*i) end else if not isCreature(itemEx.uid) then return doPlayerSendCancel(cid, "Selecione um alvo primeiro.") elseif getPlayerItemCount(cid, bullet_id) < shots_amount then return doPlayerSendCancel(cid, "Você não possui munição.") elseif exhaustion.check(cid, exhaust) then return doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, exhaust)).." segundos para usar a arma novamente.") end exhaustion.set(cid, exhaust, exhaustion_time) for i = 0, shots_amount-1 do addEvent(function() if not isCreature(itemEx.uid) then return true elseif getPlayerItemCount(cid, bullet_id) < 1 then return doPlayerSendCancel(cid, "Você não possui munição.") end doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(itemEx.uid), shot_distance_effect) doTargetCombatHealth(cid, itemEx.uid, damage_type, dmg_min, dmg_max, shot_effect) doPlayerRemoveItem(cid, bullet_id, 1) end, shots_delay*i) end end return true end data/actions/actions.xml: <action itemid="xxxx" script="pistol.lua" allowfaruse="1"/> No lugar de xxxx, coloque o id do item que será usado como pistola. Configure aqui: local need_target = true -- Precisa de target? (true / false) Se false, o sistema utilizará o Use With. local bullet_id = 2544 -- ID da munição local shots_amount = 1 -- Tiros por vez local exhaustion_time = 1 -- Segundos de exhaustion local exhaust = 19301 -- Storage da exhaustion local dmg_min, dmg_max = -10, -20 -- Dano mínimo, dano máximo local shot_effect = 3 -- Efeito do tiro local shot_distance_effect = 1 -- Distance effect do tiro local damage_type = COMBAT_PHYSICALDAMAGE -- Tipo de dano local shots_delay = 200 -- Delay dos tiros (em milissegundos) local slots = {CONST_SLOT_LEFT, CONST_SLOT_RIGHT} -- Constants dos Slots permitidos local control = 0 -- Não modifique, variável de controle Bom uso, até. Créditos: Luck Oake Link para o comentário https://xtibia.com/forum/topic/234105-pistol/ Compartilhar em outros sites More sharing options...
Furabio 258 Postado Maio 25, 2015 Share Postado Maio 25, 2015 Bem interessante o script. You see!~ Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1652712 Compartilhar em outros sites More sharing options...
Wend ll 268 Postado Maio 26, 2015 Autor Share Postado Maio 26, 2015 Bem interessante o script. You see!~ Bem interessante mesmo, estarei fazendo umas modificações aqui se ficar bom atualizado o tópico Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1652824 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Maio 26, 2015 Share Postado Maio 26, 2015 ei amigo AnnaFeeh vc sabe como arrumar use with? no meu client os items nao tem use with. como eu faço pra arrumar isso. client proprio Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1652831 Compartilhar em outros sites More sharing options...
Wend ll 268 Postado Maio 26, 2015 Autor Share Postado Maio 26, 2015 ei amigo AnnaFeeh vc sabe como arrumar use with? no meu client os items nao tem use with. como eu faço pra arrumar isso. client proprio Crie um tópico indicando o erro, para podemos ajudar Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1652833 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Maio 29, 2015 Share Postado Maio 29, 2015 oks vou fazer isso tipo sabe qnd vc coloka runa no hotkey. entao qnd faço isso no meu servidor de resident evil ele fika como se colokace bolts no hotkey. como nao existice a funçao use with no meu client. qnd faço com um outro client aparece a funçao use with Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1652930 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 2, 2015 Share Postado Junho 2, 2015 #UP Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1653912 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 5, 2015 Share Postado Junho 5, 2015 #UP Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1654519 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 11, 2015 Share Postado Junho 11, 2015 @UP Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1655438 Compartilhar em outros sites More sharing options...
Super Sonic 2 Postado Junho 11, 2015 Share Postado Junho 11, 2015 Poderia mostra as imagens por favor. Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1655440 Compartilhar em outros sites More sharing options...
heilkyses 0 Postado Junho 11, 2015 Share Postado Junho 11, 2015 2010年出演电视剧《成均馆绯闻》具龙河一角,获得KBS演技 赌场 也成为了该片在春节档的天然优势,备受业界关注。首曝法器版海报 澳门威尼斯 当展露无遗,给你的勇气点个赞。” 更有网友对尹智玄的表现大加 赌博游戏 女神经典形象。《好男儿》高露牵手张译 成功接棒孙俪海清(图) 赌球网 秀剧本之精髓,为我大小荧屏所用;将抱夸父之心,在挖掘好故事、 超碰在线视频 男弱”的现象的确承受着来自家庭和社会的巨大压力。对此,张萌觉 超碰美女视频 参演以外,还邀请到一位重量级神秘大咖进行客串表演,而影片的拍 澳门银河娱乐城 房亮瞎眼为了满足广大女粉丝的心愿,导演组特地在番外篇中曝光两 超碰在线视频 线用户点播,这段时间也被称为窗口期。《狼图腾》打破常规,借助 博彩网站 拍你的肩膀,安慰你,鼓励你。暖流涌上心头,立志一定好好学习, 澳门赌场 乐爆笑剖析时代文化“送红包”是古老中国一直延续下来的文化现象 Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1655443 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 12, 2015 Share Postado Junho 12, 2015 esse é o problema Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1655609 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 17, 2015 Share Postado Junho 17, 2015 #UP Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1656344 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 20, 2015 Share Postado Junho 20, 2015 @UP Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1657094 Compartilhar em outros sites More sharing options...
chateadoagr 12 Postado Junho 23, 2015 Share Postado Junho 23, 2015 @UP Link para o comentário https://xtibia.com/forum/topic/234105-pistol/#findComment-1657552 Compartilhar em outros sites More sharing options...
Posts Recomendados