Doitforthegains
Well-Known Member
- Joined
- Aug 30, 2014
- Messages
- 231
- Reaction score
- 74
Hey guys! So I'm making vocation levers, that when used, the lever is is suppose to reward items, change players voc, send magic effect, and finally change outfit to corrisponding voc. As of right now the only thing not registering onUse is ChangeOutfit...Heres my script. As I mentioned in the title I'm using TFS 1.2
I'm not receiving any errors in my console either..
Does anyone know why it's not registering?
Thanks in advance for your help!
Code:
local cfgItems = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}, {8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item:getActionId(13165) and getPlayerVocation(player) == 20 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have become an orc warrior!.")
local bag = player:addItem(1988) -- Bag id
for i = 1, #cfgItems do
bag:addItem(cfgItems[i][1], cfgItems[i][2])
end
doPlayerSetVocation(player, 23)
doSendMagicEffect(getThingPos(player), CONST_ME_MAGIC_HOLYAREA)
doCreatureChangeOutfit(cid, 7) --I want it to switch players outfit to ID 7 -orc warrior-
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already chosen your vocation.")
end
end
Does anyone know why it's not registering?
Thanks in advance for your help!