• 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!

TFS 1.2 Get Element Damage

lazarus321

Member
Joined
May 8, 2017
Messages
209
Reaction score
20
Anyone know why dont work my spell? I am trying to add more elemental damage to the item.


HTML:
function onCastSpell(creature, var)

    local player = Player(creature)

    local leftHand = player:getSlotItem(CONST_SLOT_LEFT)
    local leftHand2 = pushThing(player:getSlotItem(CONST_SLOT_LEFT)).itemid
    local rightHand = pushThing(player:getSlotItem(CONST_SLOT_RIGHT)).itemid
    local item = ItemType(leftHand2):getElementDamage()
    local item2 = ItemType(rightHand):getElementDamage()
    
    
    leftHand:setAttribute('elementDamage' , (item + 20))
    
    
    return true
    
end
 
1. You're scripting incorrectly, there's no such thing as pushThing anymore in 1.2.
2. You can't set attributes via strings, this isn't 0.4.
3. There is no attribute to set stuff like that, they're abilities, which cannot be set dynamically by default, but you can use my code to do so.
 
But work for physical attack, if i chance leftHand:setAttribute('elementDamage' , (item + 20)) for
leftHand:setAttribute('attack' , (item + 20)) it work.

But your code doesn't work for TFS 1.2. Would you have another way to do it?
 
Attack is an attribute, not an ability. And my code does work for 1.2, read the bottom of the post where the notes are.
 
Back
Top