PHP Code:
-- [[ INIT START ]] -- 
    
local CONFIG = { 
        
PLAYERS = { 
            {
NAME "friend name"HPPC 70}, 
            {
NAME "NAME 2"HPPC 50}, 
            {
NAME "NAME 2"HPPC 50}, 
            {
NAME "NAME 2"HPPC 50}, 
        }, 
    } 
-- [[ 
INIT END ]] -- 
 
local CREATURE_TO_HEALHPPC_TO_HEAL nil101 
 
for CREATURE in Creature.GetAll("ps") do 
    
local PLAYER_FOUND table.find(CONFIG.PLAYERSCREATURE:Name(), "NAME"
 
    if (
CREATURE:isValid() and CREATURE:isAlive() and Creature:isReachable() and PLAYER_FOUND and CREATURE:HealthPercent() < CONFIG.PLAYERS[PLAYER_FOUND].HPPC and CREATURE:HealthPercent() < HPPC_TO_HEALthen 
        CREATURE_TO_HEAL
HPPC_TO_HEAL CREATURECREATURE:HealthPercent() 
    
end 
end 
 
if (Creature.isInstance(CREATURE_TO_HEAL)) then 
    Spell
.GetByWordsOrName("heal friend"):CastSpell(CREATURE_TO_HEALCREATURE_TO_HEAL:Name()) 
    
System.Wait(200
end 
i have tried this one but cant get i work. anyone know what im doing wrong? i have it as an action.
thanks for help