JU
pedido

Spell Que Quando Usada Visualiza A Mana Do Player...

Por juan500, 04 de set. de 2012 em Scripts

3
611
juan500J
04 de setembro de 2012 às 16:56

quero uma spell que ao ser usada pode por exemplo: spell "nome do player

 

vais com que possa ver a mana do player

flw

brun123B
04 de setembro de 2012 às 17:42

Script:

 

function onCastSpell(cid, var)
   local text = var.string:len() > 0 and var.string or false
   if not text then doPlayerSendCancel(cid, "Spell requires a player name!") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return false end
   local player = getPlayerByNameWildcard(text)
   if not player then
    doPlayerSendCancel(cid, "A player with the name "..text:sub(1, 1):upper() .. text:sub(2, text:len()):lower().." is not online.")
   doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
   return false
   end
   doPlayerSendTextMessage(cid, 22, "Player "..getCreatureName(player).." has "..getCreatureMana(player).."/"..getCreatureMaxMana(player).." mana.")
   doSendMagicEffect(getThingPos(cid), 12)
return true
end

 

Lembrando que na tag não pode ter selfTarget nem needTarget e nem casterTargetOrDirection, e precisa escrever isso na tag também:

 

param="1"

 

Exemplo de tag:

 

    <instant name="Get Mana" words="exiva mana" lvl="1" mana="0" prem="0" param="1" exhaustion="2000" needlearn="0" event="script" value="exivamana.lua">
   </instant>

juan500J
04 de setembro de 2012 às 17:51

Flw manolo!!! continua assim ajudando os XTibianos que vc vai longe com seus scripts!!!