• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua pass script to latest version

-.Ktz

New Member
Joined
Feb 11, 2016
Messages
37
Reaction score
1
Hello guys can someone help me pass this script for the version of tfs 1.2 (8.60 by ninja)
Code:
function onStatsChange(cid, attacker, type, combat, value)
   if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ==7891then
     if(type == STATSCHANGE_HEALTHGAIN)or(type == STATSCHANGE_MANAGAIN)then
       if(value >=1000)then
         local metade = math.floor(value/2)   
         if getPlayerStorageValue(cid,41234)- os.time()then
           
           setPlayerStorageValue(cid,41234, os.time()+120)
           doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE,-metade,-metade, CONST_ME_NONE)
           doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT,"A sua rocky boots absorveu ".. metade .." de dano.")
           return FALSE
         end   
       end
     end
   end
   return TRUE
end

and instead of using the doTargetCombatHealth check is in manashield
 
I tried doing this but what's wrong is that I do not know use onHealthChange to replace onStatsChange could tell me how to do?
 
I tried doing this but what's wrong is that I do not know use onHealthChange to replace onStatsChange could tell me how to do?
When in doubt print :p
Code:
local equipment = {itemid = 7891, slot = 8}

function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if creature:isPlayer() then
        if creature:getSlotItem(equipment.slot) == equipment.itemid then
            print('primaryDamage', primaryDamage, 'primaryType', primaryType, 'secondaryDamage', secondaryDamage, 'secondaryType', secondaryType, 'origin', origin)
        end
    end
    return true
end
 
Back
Top