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

rune

HamTheKratos

Member
Joined
Jan 14, 2009
Messages
243
Reaction score
8
Location
I Dunno
it's not my script but i need it

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

everything work fine but if i hit someone1 the damage go to me
simple i hit myself xD

it's spider's script but i need it too

thanks....
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		local ex = - (getPlayerLevel(cid) * 1000)
		doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_RED)
		doChangeTypeItem(item.uid, item.type - 1)
		doTargetCombatHealth(cid, itemEx.uid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)
		doCreatureSay(cid, "Death Coming!", TALKTYPE_ORANGE_1)
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
	end
	return true
end
 

Similar threads

Back
Top