• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

help making the script work with a vocation

Angel Of Death

Rise Of Tibia ServerOwner
Joined
Mar 12, 2012
Messages
91
Reaction score
0
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerVoc = getPlayerVocation(cid)
	if playerVoc == 13 then                                                       <<<< i added this but not working
	doRemoveItem(item.uid, 1)
	doPlayerAddSoul(cid, 100 - getPlayerSoul(cid))
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
	elseif
	doPlayerSendCancel(cid, "Sorry, cheats doesnt work for you."    <<<< i added this but not working
	return true
	end
end                                                                                         <<<< i added this but not working
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerVoc = getPlayerVocation(cid)
	if playerVoc == 13 then -- if player vocation is equal to 13
	doRemoveItem(item.uid, 1)
	doPlayerAddSoul(cid, 100 - getPlayerSoul(cid))
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
	else -- if player vocation isn't equal to 13
	doPlayerSendCancel(cid, "Sorry, cheats doesnt work for you.")
	return true
	end
end

and you comment using '--'

example:
LUA:
--comment


you used elseif instead of else

you could of used
LUA:
elseif not playerVoc == 13 then
but using a mere 'else' will shorten the code.

You missed a bracket ')' @line 8
 
Last edited:
Back
Top