• 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 with a rune

kasea

New Member
Joined
Dec 4, 2010
Messages
30
Reaction score
0
the error msg is: Event onCastSpell not found. /script/custom/russian.lua

function onUse(cid, item, frompos, item2, topos, event)

if item.type >= 6 then
doRemoveItem(item.uid, 100)
return -1
end

n = math.random(1,6)
name = getPlayerName(cid)
rem = getCreatureHealth(cid) + getPlayerMana(cid)
if n <= item.type then
doCreatureSay(cid, "This guy got OwN3D!", TALKTYPE_ORANGE_1)
doCreatureAddHealth(cid, - rem)
else
doCreatureSay(cid, "You got lucky! ", TALKTYPE_ORANGE_1)
end

doRemoveItem(item.uid, 100)

return 1

end
 
is it revolver?

btw this script will wont work, its bugged everywhere!
tell me more about this script and item are you using for
i can write this script for you in 2 minutes
 
You don't have to use a rune, you can use any item. I would suggest using some sort of item, not a rune...

data/actions/actions.xml

Code:
<action itemid="[COLOR="#FF0000"]7735[/COLOR]" event="script" value=[COLOR="#FF0000"]"script.lua[/COLOR]"/>

data/actions/scripts/script.lua

Lua:
local config = {
	removeOnUse = true
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local chance = math.random(1, 6)
	if(chance >= 3) then -- (6 - 3 = 3) or 50% chance
		doCreatureSay(cid, "You got owned!", TALKTYPE_MONSTER)
		doCreatureAddHealth(cid, - getCreatureHealth(cid))
	else
		doCreatureSay(cid, "You lucky bastard!", TALKTYPE_MONSTER)
	end
	
	if(config.removeOnUse) then
		doRemoveItem(item.uid, 1)
	end
	return true
end
 
Back
Top