• 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 Super UH --I rep

Snach

Sensei
Joined
Aug 8, 2009
Messages
1,694
Reaction score
84
Location
Estonia
Please can someone fix me a script for UH that heals 1900-2000 hp

local t = {
min = 1900,
max = 2000,
text = "Aaaah...",
effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doPlayerAddHealth(itemEx.uid, math.random(t.min, t.max))
doCreatureSay(itemEx.uid, t.text, TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, t.effect)
else
doPlayerSendCancel(cid, "You can only use this rune on players.")
end
return true
end


Works with doPlayerAddMana, but when I change to doPlayerAddHealth, it says "you cannot use this item" ingame.
when using uh:
asdasdaq.png
 
Last edited:
data/actions/scripts/mega_uh.lua

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local lvl = 8
	if(isPlayer(itemEx.uid)) then
		if(getPlayerLevel(itemEx.uid) >= level) then
			doCreatureAddHealth(cid, math.random(1900, 2000))
			doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getCreaturePosition(itemEx.uid), CONST_ME_MAGIC_BLUE)
		else
			doPlayerSendCancel(cid, "Sorry, not possible.")
		end
	else
		doPlayerSendCancel(cid, "You cannot use this object.")
	end
	return true
end

Doesn't work =(
Edited 1st post I get an error
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local lvl = 8
	if(isPlayer(itemEx.uid)) then
		if(getPlayerLevel(itemEx.uid) >= lvl) then
			doCreatureAddHealth(itemEx.uid, math.random(1900, 2000))
			doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
			doSendMagicEffect(itemEx.uid, CONST_ME_MAGIC_BLUE)
		else
			doPlayerSendCancel(cid, "Sorry, your level is not high enough.")
		end
	else
		doPlayerSendCancel(cid, "You can only use this rune on players.")
	end
	return true
end
 
Back
Top