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

voc door help

haslo1

New Member
Joined
Jun 16, 2010
Messages
48
Reaction score
0
Code:
function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingfromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingfromPos(position)
if item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0 then
return FALSE
end
return TRUE
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = -1
if isSorcerer(cid) then
voc = 1
elseif isDruid(cid) then
voc = 2
elseif isPaladin(cid) then
voc = 3
elseif isKnight(cid) then
voc = 4
elseif isRookie(cid) then 
voc = 0
end

if item.actionid >= 8000 and item.actionid <= 8005 then
if item.actionid == 8000+voc then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return TRUE
end
return FALSE
end

i have this script is work but if u stay in door and use in door itemid transform to +1 and door is broken please help i rep ++
 
Just choose a normal leveldoor (gate of expertise) and set the actionid to the vocation id+100 (e.g. knight: 104)
 
Code:
function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingfromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingfromPos(position)
if item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0 then
return FALSE
end
return TRUE
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = -1
if isSorcerer(cid) then
voc = 1
elseif isDruid(cid) then
voc = 2
elseif isPaladin(cid) then
voc = 3
elseif isKnight(cid) then
voc = 4
elseif isRookie(cid) then 
voc = 0
end

if item.actionid >= 8000 and item.actionid <= 8005 then
if item.actionid == 8000+voc then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return TRUE
end
return FALSE
end
ineed script like this that is work but if i stay in foor and click use in me doors transform to next ids
 
Code:
function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingfromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingfromPos(position)
if item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0 then
return FALSE
end
return TRUE
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = -1
if isSorcerer(cid) then
voc = 1
elseif isDruid(cid) then
voc = 2
elseif isPaladin(cid) then
voc = 3
elseif isKnight(cid) then
voc = 4
elseif isRookie(cid) then 
voc = 0
end

if item.actionid >= 8000 and item.actionid <= 8005 then
if item.actionid == 8000+voc then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return FALSE
end
Rep++
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
if item.uid == 6000 and isSorcerer(cid) == TRUE then
     doTeleportThing(cid, toPosition, TRUE)
elseif item.uid == 6000 and isSorcerer(cid) == FALSE then
     doPlayerSendTextMessage(cid,22,"This door is for sorcerer only.")
 
elseif item.uid == 6001 and isPaladin(cid) == TRUE then
     doTeleportThing(cid, toPosition, TRUE)
elseif item.uid == 6001 and isPaladin(cid) == FALSE then
     doPlayerSendTextMessage(cid,22,"This door is for paladin only.")
 
elseif item.uid == 6002 and isDruid(cid) == TRUE then
     doTeleportThing(cid, toPosition, TRUE)
elseif item.uid == 6002 and isDruid(cid) == FALSE then
     doPlayerSendTextMessage(cid,22,"This door is for druid only.")
 
elseif item.uid == 6003 and isKnight(cid) == TRUE then
     doTeleportThing(cid, toPosition, TRUE)
elseif item.uid == 6003 and isKnight(cid) == FALSE then
     doPlayerSendTextMessage(cid,22,"This door is for knight only.")
end
     return FALSE
end


XML:
<action uniqueid="6000" script="vocationdoor.lua" />
<action uniqueid="6001" script="vocationdoor.lua" />
<action uniqueid="6002" script="vocationdoor.lua" />
<action uniqueid="6003" script="vocationdoor.lua" />
 
Back
Top