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

[help]Weapon script

NilssoN

¯\(º o)/¯
Joined
Jun 15, 2007
Messages
1,464
Reaction score
4
Location
tjaa
Hio..
I need help with me weapon script...
Code:
	local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
	setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
	setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

	local condition = createConditionObject(CONDITION_PARALYZE)
	setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
	setConditionParam(condition, CONDITION_PARAM_SPEED, -150)
	setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
	if getPlayerLevel(cid) >= 100 then
		doCombat(cid, combat, var)
	else
		doPlayerSendCancel(cid, 'You need level 100 to use this weapon.')
	end
end
I want it to paralyze RANDOMLY not all the time :(
Can someone help me? :)
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

local paralyzeChance = math.random(1, 5)

if paralyzeChance == 3 then
    local condition = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
    setConditionParam(condition, CONDITION_PARAM_SPEED, -150)
    setCombatCondition(combat, condition)
end

function onUseWeapon(cid, var)
    if getPlayerLevel(cid) >= 100 then
        return doCombat(cid, combat, var)
    else
        doPlayerSendCancel(cid, 'You need level 100 to use this weapon.')
    end
end
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

local paralyzeChance = math.random(1, 5)

if paralyzeChance == 3 then
    local condition = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
    setConditionParam(condition, CONDITION_PARAM_SPEED, -150)
    setCombatCondition(combat, condition)
end

function onUseWeapon(cid, var)
    if getPlayerLevel(cid) >= 100 then
        return doCombat(cid, combat, var)
    else
        doPlayerSendCancel(cid, 'You need level 100 to use this weapon.')
    end
end
It didn't work :/
 
PHP:
	local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
	setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
	setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

	local condition = createConditionObject(CONDITION_PARALYZE)
	setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
	setConditionParam(condition, CONDITION_PARAM_SPEED, -150)
	setCombatCondition(combat, condition)

	local combat2 = createCombatObject()
	setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
	setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
	setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
	
function onUseWeapon(cid, var)
	if getPlayerLevel(cid) >= 100 then
		local chance = math.random(1,10)
		if chance == 1 then
		doCombat(cid, combat, var)
		else
		doCombat(cid, combat2, var)
		end
	else
		doPlayerSendCancel(cid, 'You need level 100 to use this weapon.')
	end
end
 
Back
Top