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

put the level from X as normal and then in your lua script for the spell:
Code:
function onCastSpell(cid, var)
	if getPlayerLevel(cid) >= X then
		doPlayerSendCancel(cid, "Only players of level X or lower can use this spell.")
	else
	return doCombat(cid, combat, var)
	end
end
 
In the spell lua script, at the final, there is something like this:
LUA:
function onCastSpell(cid, var)
etc..
You need to replace that, for these:
LUA:
local level = getPlayerLevel(cid)
local min = x
local max = y
function onCastSpell(cid, var)
	if level >= X and level <= y then
		doPlayerSendCancel(cid, "Only players of level X or lower can use this spell.")
	else
	return doCombat(cid, combat, var)
	end
end

Hope it works....
 
Back
Top