Postado Outubro 16, 2017 7 anos BOA TARDE KINGS ! PRECISO DE UM SCRIPT PARA QUANDO O PLAYER MATAR UM MONSTRO ELE SEJA TELEPORTADO PARA O TEMPLO E GANHE +1 PONTO DE SKILL (AXE) POR EXEMPLO.
Postado Outubro 16, 2017 7 anos Este tópico foi movido para a área correta. Esta é uma mensagem automática!Pedimos que leia as regras do fórum! Spoiler This topic has been moved to the correct area. This is an automated message!Please read the forum rules. _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Outubro 16, 2017 7 anos Em creaturescritps/scripts crie um arquivo: tpskill.lua Spoiler local new_pos = {x = 1, y = 1, z = 1} -- posição para onde o player será teleportado local addSkill = SKILL_AXE -- qual o skill local amount = 1 -- quanto de skill adicionará function onDeath(cid, corpse, deathList) local player = deathList[1] doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You have defeated the " .. getCreatureName(cid).."!") doPlayerAddSkill(player, addSkill, amount) addEvent(doTeleportThing,1,player,new_pos) return true end function doPlayerAddSkill(cid, skill, amount, round) local amount = amount or 1 if(skill == SKILL__LEVEL) then return doPlayerAddLevel(cid, amount, round) elseif(skill == SKILL__MAGLEVEL) then return doPlayerAddMagLevel(cid, amount) end for i = 1, amount do doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false) end return true end No arquivo do monstro, antes de </monster>, adicione: <script> <event name="RewardTp"/> </script> Em creaturescripts.xml, adicione a tag: <event type="death" name="RewardTp" event="script" value="tpskill.lua"/> Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Outubro 16, 2017 7 anos Autor 41 minutos atrás, Dwarfer disse: Em creaturescritps/scripts crie um arquivo: tpskill.lua Ocultar conteúdo local new_pos = {x = 1, y = 1, z = 1} -- posição para onde o player será teleportado local addSkill = SKILL_AXE -- qual o skill local amount = 1 -- quanto de skill adicionará function onDeath(cid, corpse, deathList) local player = deathList[1] doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You have defeated the " .. getCreatureName(cid).."!") doPlayerAddSkill(player, addSkill, amount) addEvent(doTeleportThing,1,player,new_pos) return true end function doPlayerAddSkill(cid, skill, amount, round) local amount = amount or 1 if(skill == SKILL__LEVEL) then return doPlayerAddLevel(cid, amount, round) elseif(skill == SKILL__MAGLEVEL) then return doPlayerAddMagLevel(cid, amount) end for i = 1, amount do doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false) end return true end No arquivo do monstro, antes de </monster>, adicione: <script> <event name="RewardTp"/> </script> Em creaturescripts.xml, adicione a tag: <event type="death" name="RewardTp" event="script" value="tpskill.lua"/> Esse que estou usando é apenas para TEST. É normal aquele event ficar preto ?
Postado Outubro 16, 2017 7 anos Sim, é normal. Contato: Email: [email protected] Discord: Dwarfer#2715
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.