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

Custom spellbook

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hello, i try create custom spellbook, but i have problem this script show me everytime sorc book.

Code:
function onSay(cid, words)
if getPlayerVocation(cid) == 1 or 5 or 9 then
    local sorc = "Sorc" ..
    "\n".. --! this adds a blank line !--
    "\nThis is a simple list" .. --! the \n starts a new line, must be inside quotes !--
    "\nEasy to edit" .. --! If you add a new line put the 2 ".." at the end.
    "\nEase to add to your server" --! Does not require ".." at the end of the last line. !--
  
  
    doPlayerPopupFYI(cid, sorc)
elseif getPlayerVocation(cid) == 2 or 6 or 10 then
    local drut = "Drut" ..
    "\n".. --! this adds a blank line !--
    "\nThis is a simple list" .. --! the \n starts a new line, must be inside quotes !--
    "\nEasy to edit" .. --! If you add a new line put the 2 ".." at the end.
    "\nEase to add to your server" --! Does not require ".." at the end of the last line. !--
  
  
    doPlayerPopupFYI(cid, drut)
elseif getPlayerVocation(cid) == 3 or 7 or 11 then
    local pall = "Pall" ..
    "\n".. --! this adds a blank line !--
    "\nThis is a simple list" .. --! the \n starts a new line, must be inside quotes !--
    "\nEasy to edit" .. --! If you add a new line put the 2 ".." at the end.
    "\nEase to add to your server" --! Does not require ".." at the end of the last line. !--
  
  
    doPlayerPopupFYI(cid, pall)
elseif getPlayerVocation(cid) == 4 or 8 or 12 then
    local kina = "Kina" ..
    "\n".. --! this adds a blank line !--
    "\nThis is a simple list" .. --! the \n starts a new line, must be inside quotes !--
    "\nEasy to edit" .. --! If you add a new line put the 2 ".." at the end.
    "\nEase to add to your server" --! Does not require ".." at the end of the last line. !--
  
  
    doPlayerPopupFYI(cid, kina)
  
    return TRUE
  
end
 
Solution
look this:

if getPlayerVocation(cid) == 1 or 5 or 9 then

Every number above 0 in Lua is considered as True so basically you're saying

if vocation == 1 OR true OR true then

anything OR true is equal true, that's why. If you want to check multiple vocations you gotta repeat the comparison:

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 9 then
look this:

if getPlayerVocation(cid) == 1 or 5 or 9 then

Every number above 0 in Lua is considered as True so basically you're saying

if vocation == 1 OR true OR true then

anything OR true is equal true, that's why. If you want to check multiple vocations you gotta repeat the comparison:

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 9 then
 
Solution
look this:

if getPlayerVocation(cid) == 1 or 5 or 9 then

Every number above 0 in Lua is considered as True so basically you're saying

if vocation == 1 OR true OR true then

anything OR true is equal true, that's why. If you want to check multiple vocations you gotta repeat the comparison:

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 9 then

Thanks :D
 
Back
Top