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

adding an addon by using a given item to a given vocations

cocacola13

Member
Joined
Jan 18, 2019
Messages
179
Reaction score
12
Location
poland
Hello
I need help creating a script that adds an addon to a given vocation using itemku, the script would have to check which player has professions and must know which profession can use it and which not.
 
use TFS 1.2 sorcerer and druid together

knight and paladin separately
Post automatically merged:

I added it to login.lua but it doesn't add rank
 
Last edited:
Explain more you want Sorcerer and Druid to have specific addon on login? also EK and RP to have specific addon on login? But only if they have used an item?
 
I want a given item to be given a given first addon for a given vocations and that this item cannot be used, e.g. by a magician, if the item is for a knighit
 
Action script like this one?
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getVocation():getID() == 4 and not player:getStorageValue(34549) < 1 then
    player:addOutfitAddon(128, 1)
    player:setStorageValue(34549, 1)
    else
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You can't use this item.")
end
    return true
end
XML:
<action itemid="youritemID" script="yourscriptname.lua" />
and then you add to your something like this to your login.lua
LUA:
if player:getVocation():getID() == 4 and not player:getStorageValue(34549) < 1 then
player:addItem(YOURITEMIDHERE, 1)
end
 
Which server are you using? How can a server based on TFS 1.2 not use login.lua? If you can link me to your source I might find a solution.
 
Back
Top