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

Lua Voc doors

skully

New Member
Joined
Jan 15, 2012
Messages
50
Reaction score
0
How can I make vocation doors just like when you make a new char and it needs to take 1 of the 4 doors?
 
Uh, just make an actionscript with getPlayerVocation check or storage if they start without a vocation.
 
ifgetplayervoc(cid,x) then doplayerteleport.. or whatever it is
something like that, ill make it for u tmrw if i have time
 
Lua:
local t = {
	[1337] = {1}, -- [door action id] = {vocation}
	[1338] = {2},
	[1339] = {3},
	[1340] = {4}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = t[item.actionid]
	if(k and getPlayerVocation(cid) == k[1]) then
		doTransformItem(item.uid, item.itemid + 1)
		doTeleportThing(cid, toPosition, true)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This door seems to be sealed against unwanted intruders.")
	end
	return true
end
 
Lua:
local t = {
	[1337] = {1}, -- [door action id] = {vocation}
	[1338] = {2},
	[1339] = {3},
	[1340] = {4}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = t[item.actionid]
	if(k and getPlayerVocation(cid) == k[1]) then
		doTransformItem(item.uid, item.itemid + 1)
		doTeleportThing(cid, toPosition, true)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This door seems to be sealed against unwanted intruders.")
	end
	return true
end

Please, answer fast -
So I put on actions.xml:
<action itemid="1337;1338;1339;1340" event="script" value="vocdoor.lua"/>
? Please reply fast.
 
Please, answer fast -
So I put on actions.xml:
<action itemid="1337;1338;1339;1340" event="script" value="vocdoor.lua"/>
? Please reply fast.

In your map editor right click on the door and add a UniqueID, then in actions.xml
XML:
<action uniqueid="1212" event="script" value="door.lua"/>
UniqueID 1212 is an example you need to enter the same ID you use in your mapeditor.

Goodluck !
 
Back
Top Bottom