well if this help i had like a same porlbme but i putted a switch insted of a teleport well
here it is
function onUse(cid, item, frompos, item2, topos)
local townid = 1 -- townid of the temple
local playerpos = getPlayerPosition(cid)
local newpos = {x=435, y=483, z=7}...