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

Push lever teleports player

Samuro

GameDev
Joined
Aug 7, 2007
Messages
1,846
Reaction score
572
Location
Sweden
Hey, I need an easy and simple script for when you push a lever it takes you to another position. I've searched for it and failed finding anything.

Rep to anyone who can find me a thread on it or make me one :)
 
data/actions/scripts/scriptname.lua
Code:
local config = {
	position = {x = 100, y = 100, z = 7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
		return TRUE
	end

	doTransformItem(item.uid, 1946)
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	doTeleportThing(cid, config.position)
	doSendMagicEffect(config.position, CONST_ME_TELEPORT)
	return TRUE
end
data/actions/actions.xml:
  • TFS 0.2:
    Code:
    	<action uniqueid="10000" script="scriptname.lua"/>
  • TFS 0.3:
    Code:
    	<action uniqueid="10000" event="script" value="scriptname.lua"/>
 
Puff when you vanish :thumbup:

LUA:
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
 
Well they are dumb, because when you vanish, why would you make a blue circle? You're supposed to make smoke. (Puff) :p
 
data/actions/scripts/scriptname.lua
Code:
local config = {
	position = {x = 100, y = 100, z = 7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
		return TRUE
	end

	doTransformItem(item.uid, 1946)
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	doTeleportThing(cid, config.position)
	doSendMagicEffect(config.position, CONST_ME_TELEPORT)
	return TRUE
end
data/actions/actions.xml:
  • TFS 0.2:
    Code:
    	<action uniqueid="10000" script="scriptname.lua"/>
  • TFS 0.3:
    Code:
    	<action uniqueid="10000" event="script" value="scriptname.lua"/>

Thanks, already repped you once, can't do it again for a while :/
 
Back
Top