View Full Version : Equip energy ring if health is below X
jollebollen
02-04-2016, 02:57 PM
Do someone have this .lua script? Would be nice in wars :D
I know this script exist for SSA but idk for rings!
This is how the SSA looks like:
-- Config
local ssaID = 3081 -- Id of your stone skin amulet
local AmuOLD = 16113 -- Id of your normal amulet
local health = 20 -- x% to equip your ssa
local healthUNQ = 80 -- x% to UNequip your ssa
-- Don't touch this if you don't know what are you doing
Self.HealthPercent = function()
return math.abs(Self.Health()/(Self.MaxHealth()*0.01))
end
Module.New('ssaquip', function(mod)
if Self.HealthPercent() <= health and Self.Amulet().id == AmuOLD then
Self.Equip(ssaID, "amulet")
end
if Self.HealthPercent() >= healthUNQ then
Self.Equip(AmuOLD, "amulet")
end
end)
Thanks alot.
Oscagi
02-04-2016, 04:51 PM
-- Config
local RingID = 3051 -- Id of your energy ring
local NormalRing = 3006 -- Id of your normal ring (3006 <- ring of the sky)
local health = 20 -- x% to equip your ering
local healthUNQ = 80 -- x% to UNequip your ering
-- Don't touch this if you don't know what are you doing
Self.HealthPercent = function()
return math.abs(Self.Health()/(Self.MaxHealth()*0.01))
end
Module.New('eringequip', function(mod)
if Self.HealthPercent() <= health and Self.Ring().id == NormalRing then
Self.Equip(RingID, "ring")
end
if Self.HealthPercent() >= healthUNQ then
Self.Equip(NormalRing, "ring")
end
end)
jollebollen
02-04-2016, 06:35 PM
-- Config
local RingID = 3051 -- Id of your energy ring
local NormalRing = 3006 -- Id of your normal ring (3006 <- ring of the sky)
local health = 20 -- x% to equip your ering
local healthUNQ = 80 -- x% to UNequip your ering
-- Don't touch this if you don't know what are you doing
Self.HealthPercent = function()
return math.abs(Self.Health()/(Self.MaxHealth()*0.01))
end
Module.New('eringequip', function(mod)
if Self.HealthPercent() <= health and Self.Ring().id == NormalRing then
Self.Equip(RingID, "ring")
end
if Self.HealthPercent() >= healthUNQ then
Self.Equip(NormalRing, "ring")
end
end)
Wow so fast :) well done sir I will try it when I get home. Very much appreciate it I hope you know that!!
jollebollen
02-04-2016, 06:46 PM
-- Config
local RingID = 3051 -- Id of your energy ring
local NormalRing = 3006 -- Id of your normal ring (3006 <- ring of the sky)
local health = 20 -- x% to equip your ering
local healthUNQ = 80 -- x% to UNequip your ering
-- Don't touch this if you don't know what are you doing
Self.HealthPercent = function()
return math.abs(Self.Health()/(Self.MaxHealth()*0.01))
end
Module.New('eringequip', function(mod)
if Self.HealthPercent() <= health and Self.Ring().id == NormalRing then
Self.Equip(RingID, "ring")
end
if Self.HealthPercent() >= healthUNQ then
Self.Equip(NormalRing, "ring")
end
end)
btw possible to do it but without having an "original" ring?
like it will only equip energy ring and I have to remove it myself?
thanks in advance :)
Jontor
02-04-2016, 08:29 PM
btw possible to do it but without having an "original" ring?
like it will only equip energy ring and I have to remove it myself?
thanks in advance :)
Just remove these 3 lines:
if Self.HealthPercent() >= healthUNQ then
Self.Equip(NormalRing, "ring")
end
jollebollen
02-04-2016, 08:51 PM
Just remove these 3 lines:
if Self.HealthPercent() >= healthUNQ then
Self.Equip(NormalRing, "ring")
end
thank you master :D
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.