• 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 X Percent to paralize

Szafi

www.rookwar.pl
Joined
Mar 2, 2009
Messages
165
Reaction score
10
Location
Poland
TFS 0.4

need help, how make X % to paralize player?

Code:
local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 4, 1000, -100)
setCombatCondition(combat, condition)

thanks for solution
 
Would help if we knew the question...
You want to paralyze a player if their hp is at x percent?
You want to paralyze a player at a random chance of x percent?

If english isn't your 1st language then use your native tongue.
 
Would help if we knew the question...
You want to paralyze a player if their hp is at x percent?
You want to paralyze a player at a random chance of x percent?

If english isn't your 1st language then use your native tongue.
I want to paralyze a player at a random chance of x percent.

Example:
5% chance that it will be paralyze


Code:
local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 4, 1000, -100)
setCombatCondition(combat, condition)


local paralyze = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralyze, CONDITION_PARAM_TICKS, 5000)
setConditionFormula(paralyze, -0.9, 0, -0.9, 0)
setCombatCondition(combat, paralyze)

I do not know how to write the function :/

PS:
local condition = is always



@edit

Code:
function onUseWeapon(cid, var)

    rand = math.random(4)
    print(rand)
    if rand == 1 then

        setConditionParam(paralyze, CONDITION_PARAM_TICKS, 5000)
        setConditionFormula(paralyze, -0.9, 0, -0.9, 0)
        setCombatCondition(combat, paralyze)
    end

I make this. Why if rand=1 and random is 3 or 4 have 100% chance to paralize?
 
Last edited:
Back
Top