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

No damage

Xleniz

New Member
Joined
Jul 6, 2009
Messages
178
Reaction score
3
Location
Sweden
I'm trying to make a lua script that makes no damage if playerstoragevalue is same, but doesn't work.

here's code:
Code:
local immunity = {
        [COMBAT_ENERGYDAMAGE] = {1000, COMBAT_ENERGYDAMAGE},
        [COMBAT_EARTHDAMAGE] = {1001, COMBAT_EARTHDAMAGE},
        [COMBAT_POISONDAMAGE] = {1002, COMBAT_POISONDAMAGE},
        [COMBAT_FIREDAMAGE] = {1003, COMBAT_ICEEDAMAGE},
        [COMBAT_ICEDAMAGE] = {1004, COMBAT_FIREDAMAGE},
        [COMBAT_HOLYDAMAGE] = {1005, COMBAT_HOLYDAMAGE},
        [COMBAT_DEATHDAMAGE] = {1006, COMBAT_DEATHDAMAGE},
        [COMBAT_PHYSICALDAMAGE] = {1007, COMBAT_PHYSICALDAMAGE}
}

function onStatsChange(cid, attacker, type, combat, value)
	if(type == STATSCHANGE_HEALTHLOSS) then
		if(getPlayerStorageValue(cid, 1400)==1) then
			if(getPlayerStorageValue(attacker, 1400)==1) then
				local val = immunity[combat]
			end
		end
	end
    return true
end
 
Code:
function onStatsChange(cid, attacker, type, combat, value)
	if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) and getPlayerStorageValue(cid, 1400) == 1 and getPlayerStorageValue(attacker, 1400) == 1 then
		return false
	end
	return true
end
 
Back
Top