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

[Action] Manarune for level 400+

Snach

Sensei
Joined
Aug 8, 2009
Messages
1,694
Reaction score
84
Location
Estonia
I have a manarune with action script.How can i make so only players with level 400+ can use it?
 
Last edited:
LUA:
local mana = 500

function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) < 400 then
doPlayerSendCancel(cid, "Only players above level 400 can use this manarune.")
elseif getPlayerLevel > 400 then
doPlayerAddMana(cid, mana)
end
return true
end

change "500" to how much mana it should heal


tell me if it works
 
Last edited:
But i have action scripts. Spell scripts dint work for me.
action script:
Code:
local t = {
min = 1400,
max = 1500,
text = "Aaaah...",
effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doPlayerAddMana(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
 
LUA:
local t = {
min = 1400,
max = 1500,
effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) < 400 then
doPlayerSendCancel(cid, "Only players above level 400 can use this manarune.")
elseif getPlayerLevel(cid) > 400 then
doPlayerAddMana(itemEx.uid, math.random(t.min, t.max))
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(topos, t.effect)
end
return true
end

try
 
Code:
local t = {
	min = 1400,
	max = 1500,
	text = "Aaaah...",
	effect = CONST_ME_MAGIC_BLUE,
	level = 400
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		if getPlayerLevel(cid) >= t.level then
			doPlayerAddMana(itemEx.uid, math.random(t.min, t.max))
			doCreatureSay(itemEx.uid, t.text, TALKTYPE_ORANGE_1)
			doSendMagicEffect(toPosition, t.effect)
		else
			doPlayerSendCancel(cid, "You need atleast level " .. t.level .. " to use this rune.")
		end
	else
		doPlayerSendCancel(cid, "You can only use this rune on players.")
	end
	return true
end
Also, you didn't make it (http://otland.net/748484-post5.html)
 
Code:
local t = {
	min = 1400,
	max = 1500,
	text = "Aaaah...",
	effect = CONST_ME_MAGIC_BLUE,
	level = 400
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		if getPlayerLevel(cid) >= t.level then
			doPlayerAddMana(itemEx.uid, math.random(t.min, t.max))
			doCreatureSay(itemEx.uid, t.text, TALKTYPE_ORANGE_1)
			doSendMagicEffect(toPosition, t.effect)
		else
			doPlayerSendCancel(cid, "Your level is too low.")
		end
	else
		doPlayerSendCancel(cid, "You can only use this rune on players.")
	end
	return true
end
Also, you didn't make it (http://otland.net/748484-post5.html)

kurwa XD does my script work?
 
Code:
local t = {
	min = 1400,
	max = 1500,
	text = "Aaaah...",
	effect = CONST_ME_MAGIC_BLUE,
	level = 400
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		if getPlayerLevel(cid) >= t.level then
			doPlayerAddMana(itemEx.uid, math.random(t.min, t.max))
			doCreatureSay(itemEx.uid, t.text, TALKTYPE_ORANGE_1)
			doSendMagicEffect(toPosition, t.effect)
		else
			doPlayerSendCancel(cid, "Your level is too low.")
		end
	else
		doPlayerSendCancel(cid, "You can only use this rune on players.")
	end
	return true
end
Also, you didn't make it (http://otland.net/748484-post5.html)

Yea sorry forgot to mention :D
 
Back
Top