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

Lua Critical Chance and Hidden Attributes

Silverfins

New Member
Joined
Jun 10, 2022
Messages
2
Reaction score
1
I apologize if this isn't the correct place to post this.
I've been wracking my brain over this one and I could use some help.

I'm trying to figure out a way to add 5% critical hit chance and 100% critical hit damage to all players by default, as baseline stats.
Is there any way to do this? Perhaps a permanent condition or something?

If this can't be done, could I hide the critical extra damage from weapons, so that it doesn't show when looked at?
I'm using TFS 1.4.1

thank you
 
Solution
Lua:
local cfg = {
              increaseChance = 5,
              increaseHit = 100,
            }

local creatureevent = CreatureEvent("permaCritical_onLogin")
function creatureevent.onLogin(player)
    local condition = Condition(CONDITION_ATTRIBUTES)
    condition:setParameter(CONDITION_PARAM_SPECIALSKILL_CRITICALHITCHANCE, cfg.increaseChance)
    condition:setParameter(CONDITION_PARAM_SPECIALSKILL_CRITICALHITAMOUNT, cfg.increaseHit)
    condition:setTicks(-1)
    player:addCondition(condition)
    return true
end
creatureevent:register()

make .lua file name it whatever and place it into data/scripts
Lua:
local cfg = {
              increaseChance = 5,
              increaseHit = 100,
            }

local creatureevent = CreatureEvent("permaCritical_onLogin")
function creatureevent.onLogin(player)
    local condition = Condition(CONDITION_ATTRIBUTES)
    condition:setParameter(CONDITION_PARAM_SPECIALSKILL_CRITICALHITCHANCE, cfg.increaseChance)
    condition:setParameter(CONDITION_PARAM_SPECIALSKILL_CRITICALHITAMOUNT, cfg.increaseHit)
    condition:setTicks(-1)
    player:addCondition(condition)
    return true
end
creatureevent:register()

make .lua file name it whatever and place it into data/scripts
 
Solution
Back
Top