ibkfly
New Member
- Joined
- Jan 1, 2010
- Messages
- 69
- Reaction score
- 4
Hello, i need help with my action script for second promotion. When i use the item, nothing happens. The item id is correct. I use TFS 1.1.
Thanks in advance
Code:
function onUse(cid, item, frompos, itemEx, topos)
local player = Player(cid)
local vocs = {11,12,13,14,15,18}
if player:getLevel() < 1000 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 1000 or higher to use this!")
end
if isInArray(vocs,player:getVocation()) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already got your second promotion!")
return false
else
local vucs = {1,2,3,4,9,16}
if isInArray(vucs,player:getVocation()) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to get your first promotion before using this!")
else
-- If master sorcerer
if player:getVocation() == 5 then
player:setVocation(11)
item:remove(item.uid)
-- If elder druid
elseif player:getVocation() == 6 then
player:setVocation(12)
item:remove(item.uid)
-- If royal paladin
elseif player:getVocation() == 7 then
player:setVocation(13)
item:remove(item.uid)
-- If elite knight
elseif player:getVocation() == 8 then
player:setVocation(14)
item:remove(item.uid)
elseif player:getVocation() == 10 then
player:setVocation(15)
item:remove(item.uid)
elseif player:getVocation() == 17 then
player:setVocation(18)
item:remove(item.uid)
end
end
end
return true
end
Thanks in advance
Code:
function onUse(cid, item, frompos, itemEx, topos)
local player = Player(cid)
local vocs = {11,12,13,14,15,18}
if player:getLevel() < 1000 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 1000 or higher to use this!")
end
if isInArray(vocs,player:getVocation()) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already got your second promotion!")
return false
else
local vucs = {1,2,3,4,9,16}
if isInArray(vucs,player:getVocation()) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to get your first promotion before using this!")
else
-- If master sorcerer
if player:getVocation() == 5 then
player:setVocation(11)
item:remove(item.uid)
-- If elder druid
elseif player:getVocation() == 6 then
player:setVocation(12)
item:remove(item.uid)
-- If royal paladin
elseif player:getVocation() == 7 then
player:setVocation(13)
item:remove(item.uid)
-- If elite knight
elseif player:getVocation() == 8 then
player:setVocation(14)
item:remove(item.uid)
elseif player:getVocation() == 10 then
player:setVocation(15)
item:remove(item.uid)
elseif player:getVocation() == 17 then
player:setVocation(18)
item:remove(item.uid)
end
end
end
return true
end