looking for a script for using terra amulet at X % HP
for example
use terra if health % below 80
i need for banuta ;d
looking for a script for using terra amulet at X % HP
for example
use terra if health % below 80
i need for banuta ;d
If you want it to work faster lower the wait times at line 11 and 14
Also I havnt been scripting for xb for a very long time now so try it safely, you could set the % to 99 and walk into a firebomb a couple of times and see if it equips it
lua code:
Amulet = "Terra Amulet" -- neck to equip
HP = 80 -- % to equip at
Self.HealthPercent = function ()
return math.abs(Self.Health() / (Self.MaxHealth() * 0.01))
end
Module.New('amulethp', function(mod)
if (Self.HealthPercent() <= HP) and (Self.Amulet() ~= Amulet) then
Self.Equip(Amulet, "amulet")
mod:Delay(10000)
else
Self.Dequip("amulet", 0)
mod:Delay(2000)
end
end)
Last edited by Merre; 12-31-2015 at 03:07 PM.
lua code:local HPPC = 80 -- health percent
local CONDITIONAL_AMULET_NAME = "terra amulet" -- use if current hp < HPPC
local DEFAULT_AMULET_NAME = "platinum amulet" -- use if current hp > HPPC
function swap()
if (Self.Health() / Self.MaxHealth() * 100 < HPPC) then
if (Self.Amulet().id ~= Item.GetID(CONDITIONAL_AMULET_NAME) and Self.ItemCount(CONDITIONAL_AMULET_NAME) > 0) then
Self.Equip(CONDITIONAL_AMULET_NAME, "amulet")
wait(300,500)
end
else
if (Self.Amulet().id == Item.GetID(CONDITIONAL_AMULET_NAME) and Self.ItemCount(DEFAULT_AMULET_NAME) > 0) then
Self.Equip(DEFAULT_AMULET_NAME, "amulet")
wait(300, 500)
end
end
end
Module.New("Equip Amulet", function(mod)
swap()
mod:Delay(1000)
end)
Only use wait in modules if it's between two actions, it puts everything else in the script on hold. Just use mod:delay instead.