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

Item, Lever and Teleport script

Velington

Server/Web Developer
Joined
Jan 3, 2012
Messages
122
Reaction score
0
Location
Sweden
Hello i just working on a quest right now. I would need a script there you put a item at some postiton. Then you draw the lever and woops there will be a teleport! Anyone?

Please tell me where i will paste it too!
 
LUA:
local t = {
	[3900] = {{{x=x, y=y, z=z}, 3051}, {{x=x, y=y, z=z}, 2000} }
	--[action id of the lever] = {{{position to check}, item id to check}, {{pos of the teleport}, actionid of the teleport}}
	}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = t[item.actionid]
	if getTileItemById(v[1][1], v[1][2]) == true then
		doItemSetAttribute(doCreateItem(1387, 1, v[2][1]), 'aid', v[2][2])
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
	else
		doPlayerSendCancel(cid, 'Sorry, not possible')
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
return (item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)) and true
end
 
Back
Top