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

Using item depending on vocation

calveron

Bravemansworld
Joined
Feb 5, 2008
Messages
165
Reaction score
13
Location
Sweden
So basicly I want to use a book that opens a modalwindow. Depending on your vocation, it will open different windows! Using tfs 1.1

For a mage it should be this
Code:
player:sendSkillPointsWindow()
For a knight it should be
Code:
player:sendSkillPointsWindow2()
And for a paladin
Code:
player:sendSkillPointsWindow3()

I've tried some stuff but nothing really works, anybody thats up for helping me?

edit
Here's the current code I use:
Code:
function onUse(player, cid, item, fromPosition, itemEx, toPosition)
        player:sendSkillPointsWindow()
return true
end
 
Last edited:
First
Local voc = getPlayerVocation(cid)
If voc == 1 or voc == 5 then
Your codes hère
Elseif voc == 2 or voc == 6 then
....
.....
....
Else
Return true
End

Im on a cellpone cant edit the whole code for you but here's the structure ;)
 
function onUse(player, cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
-- for mage --
local modal = ModalWindow(1, "Modal Title", "Make your choice:")
modal:addChoice(1, "I want to live")
modal:addChoice(2, "Pft, I don't give a f*ck")
modal:addChoice(3, "Please... NO!")
modal:addChoice(4, "Be my guest.")
-- for knight --
local modal2 = ModalWindow(1, "Modal Title", "Make your choice:")
modal2:addChoice(1, "I want to live")
modal2:addChoice(2, "Pft, I don't give a f*ck")
modal2:addChoice(3, "Please... NO!")
modal2:addChoice(4, "Be my guest.")
-- for paladin --
local modal3 = ModalWindow(1, "Modal Title", "Make your choice:")
modal3:addChoice(1, "I want to live")
modal3:addChoice(2, "Pft, I don't give a f*ck")
modal3:addChoice(3, "Please... NO!")
modal3:addChoice(4, "Be my guest.")

Local voc = getPlayerVocation(cid)
if voc == 1 or voc == 5 then
modal:sendToPlayer(player)
elseif voc == 2 or voc == 6 then
modal:sendToPlayer(player)
elseif voc == 4 or voc == 8 then
modal2:sendToPlayer(player)
elseif voc == 3 or voc == 7 then
modal3:sendToPlayer(player)
else
end
return true
end

I dont really know either how to use modal window but i thinks this should work, i based it on this exemple :
http://otland.net/threads/tfs-1-0-modal-window.204910/

:p
 
That would work great, and will be my solution with another modalwindow script I have.
However, I have another system for the modalwindow that works diferently, that's why I guess I need to use
Code:
player:sendSkillPointsWindow()
to make it work..
 
:p if you want exact answer for your distro you should at least say which one you are using in your post ;)
 
Back
Top