• 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 Issues with lever / action

Hultin

Member
Joined
Dec 2, 2008
Messages
262
Reaction score
17
I've created a lever I want players to use to get teleported to another location, it looks like this

Actions.xml
XML:
<action actionid="55001" event="script" value="custom/trainingelev.lua"/>

and trainingelev.lua
Lua:
function onUse(cid)
	local curpos = getCreaturePosition(cid)
	if(curpos.x == 1075 and curpos.y == 1077 and curpos.z == 6) then
		doTeleportThing(cid, {x = 1092,y = 1074,z = 15})
	end
end

I get no errors, but nothing happens when I use the lever I've set the id to. just to make sure it works I've tried just printing something in the chat when you use it. I've also made sure there's solid ground on the spot it tries to teleport you to.
 
Last edited:
Why check position if its only 1 player?
Lua:
function onUse(cid)
doTeleportThing(cid, {x = 1092,y = 1074,z = 15})
return true
end
 
Why check position if its only 1 player?
Lua:
function onUse(cid)
doTeleportThing(cid, {x = 1092,y = 1074,z = 15})
return true
end
Yea its useless unless he wanted the player to stand on a certain tile to get teleported.
 
Exactly, you will have to stand on a specific tile for it to work. It's a elevator, after all ;)

I've discovered that it has something to do with doTeleportThing() not wanting to send me to far down (if I set to floor 8 it works fine, and stops at 9) but I cannot find doTeleportThing() in any file so no idea how to check the function and edit if needed
 
Last edited:
nor do I, but it doesn't "/ I would proabably be able to figure it out if I had the source codes. But then again, I'm using the 8.60 tfs 0.4 Alpha, don't ask why.
 
Back
Top