View Full Version : Use My Health potion on my friend
sholh
12-17-2015, 12:24 PM
i wanna script that use my UHP on my Frined Name when his hp i low can?
Syntax
anoyn
shadowart
Rif
kontgat
12-17-2015, 12:38 PM
You just posted this thread 3x.
You just posted this thread 3x.
You just posted this thread 3x.
sholh
12-17-2015, 02:24 PM
You just posted this thread 3x.
You just posted this thread 3x.
You just posted this thread 3x.
i never post it before :S
sholh
12-17-2015, 11:42 PM
i have this code but it doesnt working with me
local friends = { -- add targets u want to heal and at what percent
['Joker'] = 100,
['Joker'] = 100
}
local option = {
potion_id = 7643 -- what potion to heal friend
}
Module.New('HEAL', function(mod)
for name, percent in pairs(friends) do
local c = Creature.New(name)
if (c:isOnScreen()) then
if (c:HealthPercent() < percent and c:DistanceFromSelf() == 1) then
Self.UseItemWithCreature(option['potion_id'], c:ID())
breaking = true
break
end
end
end
mod:Delay(1000)
end)
sholh
12-18-2015, 12:12 PM
any one help please
sholh
12-18-2015, 07:52 PM
any help? please
dinmamma
12-18-2015, 08:25 PM
sholh
Well, just a tip, it doesn't help to tag these people for these kind of stuffs, they most likely ignore you.
Here is someting I used before to manapump my chars, abit modified.
function pumpMana()
local charToPump = Creature.New("Friend Name")
local charToPumpPos = charToPump:Position()
local manaId = 268 -- rune, pot ID etc...
local healthPercent = 50 -- friends hp % below this value to heal
local distance = 2 -- range to target, if u want to limit it, otherwise set to 8
local backpack = Container.GetByName("backpack") -- Open backpack containing healing runes
if (Self.DistanceFromPosition(charToPumpPos.x, charToPumpPos.y, charToPumpPos.z) <= distance) and (Self.Position().z == charToPumpPos.z) and (charToPump:HealthPercent() < healthPercent) then
for spots = 0, backpack:ItemCount() do
local item = backpack:GetItemData(spots)
if (item.id == manaId) then
backpack:UseItemWithCreature(spots, charToPump:ID())
break
end
end
end
end
while true do
pumpMana()
wait(900,1100)
end
Also don't forget to change container name if u aren't using regular "backpack" to hold healing items.
sholh
12-19-2015, 01:02 AM
sholh
Well, just a tip, it doesn't help to tag these people for these kind of stuffs, they most likely ignore you.
Here is someting I used before to manapump my chars, abit modified.
function pumpMana()
local charToPump = Creature.New("Friend Name")
local charToPumpPos = charToPump:Position()
local manaId = 268 -- rune, pot ID etc...
local healthPercent = 50 -- friends hp % below this value to heal
local distance = 2 -- range to target, if u want to limit it, otherwise set to 8
local backpack = Container.GetByName("backpack") -- Open backpack containing healing runes
if (Self.DistanceFromPosition(charToPumpPos.x, charToPumpPos.y, charToPumpPos.z) <= distance) and (Self.Position().z == charToPumpPos.z) and (charToPump:HealthPercent() < healthPercent) then
for spots = 0, backpack:ItemCount() do
local item = backpack:GetItemData(spots)
if (item.id == manaId) then
backpack:UseItemWithCreature(spots, charToPump:ID())
break
end
end
end
end
while true do
pumpMana()
wait(900,1100)
end
Also don't forget to change container name if u aren't using regular "backpack" to hold healing items.
at the first thx for help but its doesnt working with me :S
dinmamma
12-19-2015, 12:42 PM
at the first thx for help but its doesnt working with me :S
You probably did wrong with changing name on container in the script, i'll make it abit easier for you.
Change the "Bag" to te right container... i.e "Backpack" or "Red Backpack"
function pumpMana()
local charToPump = Creature.New("Friend Name")
local charToPumpPos = charToPump:Position()
local manaId = 268 -- rune, pot ID etc...
local healthPercent = 50 -- friends hp % below this value to heal
local bpName = "Bag" -- name of the container where the pots are
local distance = 2 -- range to target, if u want to limit it, otherwise set to 8
local backpack = Container.GetByName(bpName)
if (Self.DistanceFromPosition(charToPumpPos.x, charToPumpPos.y, charToPumpPos.z) <= distance) and (Self.Position().z == charToPumpPos.z) and (charToPump:HealthPercent() < healthPercent) then
for spots = 0, backpack:ItemCount() do
local item = backpack:GetItemData(spots)
if (item.id == manaId) then
backpack:UseItemWithCreature(spots, charToPump:ID())
break
end
end
end
end
while true do
pumpMana()
wait(900,1100)
end
sholh
12-20-2015, 01:15 PM
You probably did wrong with changing name on container in the script, i'll make it abit easier for you.
Change the "Bag" to te right container... i.e "Backpack" or "Red Backpack"
function pumpMana()
local charToPump = Creature.New("Friend Name")
local charToPumpPos = charToPump:Position()
local manaId = 268 -- rune, pot ID etc...
local healthPercent = 50 -- friends hp % below this value to heal
local bpName = "Bag" -- name of the container where the pots are
local distance = 2 -- range to target, if u want to limit it, otherwise set to 8
local backpack = Container.GetByName(bpName)
if (Self.DistanceFromPosition(charToPumpPos.x, charToPumpPos.y, charToPumpPos.z) <= distance) and (Self.Position().z == charToPumpPos.z) and (charToPump:HealthPercent() < healthPercent) then
for spots = 0, backpack:ItemCount() do
local item = backpack:GetItemData(spots)
if (item.id == manaId) then
backpack:UseItemWithCreature(spots, charToPump:ID())
break
end
end
end
end
while true do
pumpMana()
wait(900,1100)
end
thx its working fine
browny1980
12-21-2015, 08:42 AM
I couldnt get it to work it wont target my player....this script would be great any help WOuld be appreciated
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.