• 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 death Rune

SpiderOT

™ツʂριԃҽɾσƚ➽ ٩(•‿•)۶★彡
Joined
Sep 29, 2008
Messages
1,062
Solutions
9
Reaction score
288
Location
Egypt/cairo
hello all
can anyone fix this script? it is about a rune like sd but finite rune (in action not spell) everything work fine but if i hit someone1 the damage go to me
simple i hit myself xD
here is the script
Code:
function onUse(cid, item, frompos, item2, topos)
storevalue = 1000
exhaustion = 1
smallruneid = 2307
lv = getPlayerLevel(cid)
ex = -(lv*1000)
    if (item.itemid == smallruneid) then
	    exhast = exhaust(cid, storevalue, exhaustion)
        if (exhast == 0) then
        doPlayerSendCancel(cid, "You are exhausted.")
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are exhausted.")
        else
        if (item.type > 1) then
		doSendMagicEffect(getPlayerPosition(cid), 29)
        doChangeTypeItem(item.uid, item.type-1)
		doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)
		doCreatureSay(cid, "Death Coming!", TALKTYPE_ORANGE_1)
        else
		doSendMagicEffect(getPlayerPosition(cid), 29)
		doCreatureSay(cid, "Death Coming", TALKTYPE_ORANGE_1)
        doRemoveItem(item.uid, 1)
	    doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)
        end
        end
    end
end
function exhaust(cid, storevalue, exhausttime)
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storevalue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhausttime == nil or exhausttime < 0) then
        exhausttime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhausttime or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust) 
        return 1
    else
        return 0
    end
end
i think the problem in
Code:
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)
 
Back
Top