Postado Agosto 27, 2016 8 anos Boa tarde, eu estou precisando de uma spell que troque 1 ankh por 1 soul points, alguem poderia me ajudar com essa spell ?
Postado Agosto 27, 2016 8 anos local config = { item = 2193, -- itemId itemCount = 1, -- quantos items soul = 1, -- quanto de soul vai ganhar message = 'You need one ankh to gain a soul.', } function onSay(cid, words, param) if not getPlayerItemCount(cid, config.item, config.itemCount) then doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message)) return true end doPlayerRemoveItem(cid, config.item) doPlayerAddSoul(cid, config.soul) doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul)) return false end Creditos: Vankk
Postado Agosto 27, 2016 8 anos Autor 33 minutos atrás, Pepeco disse: local config = { item = 2193, -- itemId itemCount = 1, -- quantos items soul = 1, -- quanto de soul vai ganhar message = 'You need one ankh to gain a soul.', } function onSay(cid, words, param) if not getPlayerItemCount(cid, config.item, config.itemCount) then doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message)) return true end doPlayerRemoveItem(cid, config.item) doPlayerAddSoul(cid, config.soul) doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul)) return false end Creditos: Vankk Nice, mas nesse caso só funciona como talkaction, certo? Seria possivel voce colocar pra gastar 1% da mana e 1 segundo de exhaust pra usar, pra ficar parecido com uma spell mesmo ? @EDIT Esqueci de dizer, eu to usando TFS 0.4 8.60 Editado Agosto 27, 2016 8 anos por yolocaust (veja o histórico de edições)
Postado Agosto 28, 2016 8 anos @yolocaust local config = { item = 2193, -- itemId itemCount = 1, -- quantos items soul = 1, -- quanto de soul vai ganhar message = 'You need one ankh to gain a soul.', storage = 165786, exhaust = 1, -- tempo em segundos. } local percent = getPlayerMana(cid)/100 function onSay(cid, words, param) if not getPlayerItemCount(cid, config.item, config.itemCount) then doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message)) return true end if getPlayerStorageValue (cid, config.storage) < os.time() then doPlayerRemoveItem(cid, config.item) doPlayerAddSoul(cid, config.soul) doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul)) setPlayerStorageValue (cid, config.storage, config.exhaust + os.time()) doPlayerAddMana (cid, -percent) else doPlayerSendCancel (cid, "You're exhausted.") end return false end Editado Agosto 28, 2016 8 anos por Talesigorvr (veja o histórico de edições) Não dou suporte via PM, crie um tópico caso tenha dúvidas. Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.
Postado Agosto 28, 2016 8 anos Autor 1 hora atrás, Talesigorvr disse: @yolocaust local config = { item = 2193, -- itemId itemCount = 1, -- quantos items soul = 1, -- quanto de soul vai ganhar message = 'You need one ankh to gain a soul.', storage = 165786, exhaust = 1, -- tempo em segundos. } local percent = getPlayerMana(cid)/100 function onSay(cid, words, param) if not getPlayerItemCount(cid, config.item, config.itemCount) then doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message)) return true end if getPlayerStorageValue (cid, config.storage) < os.time() then doPlayerRemoveItem(cid, config.item) doPlayerAddSoul(cid, config.soul) doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul)) setPlayerStorageValue (cid, config.storage, config.exhaust + os.time()) doPlayerAddMana (cid, -percent) else doPlayerSendCancel (cid, "You're exhausted.") end return false end @Talesigorvr Nao funcionou e deu erro na distro:
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.