Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
local config = {
[2160] = {x = 100, y = 100, z = 7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = config[item.itemid]
if position == nil then
return false
end
Player(cid):teleportTo(position)
return true
end
local truepos = {x=1000, y=1000, z=7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= Place_level_here then
doTeleportThing(cid, truepos, TRUE)
doCreatureSay(cid, "Teleported!", 19)
end
return true
end
Harder than that isnt it
Way easier configurable aswell
Heres a version where the player cant teleport if pz locked
Code:
local truepos = {x=1000, y=1000, z=7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayerPzLocked(cid) then
doTeleportThing(cid, truepos, FALSE)
doCreatureSay(cid, "You cannot teleport while pz locked!", 19)
else
doTeleportThing(cid, truepos, TRUE)
doCreatureSay(cid, "Teleported!", 19)
end
return true
end
Ok, you choose whatever script you wanna use then you go to data -> Actions and then your gonna see a file called "actions.xml" click on edit and add a new actions line and define what item you wanna use. You also gotta point the value="teleportfile.lua" thingy aswell. you gotta define where your file is.
Aww, it wouldn't work, and I noticed it said "function," rather than "script." So I changed it to script, and it debugged me.
Maybe another script would work?
local truepos = {x=1000, y=1000, z=7} -- Position the player will be send when use
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Function
if isPlayerPzLocked(cid) then -- PZlock check
doTeleportThing(cid, truepos, FALSE) -- if Pzlock it do not teleport
doCreatureSay(cid, "You cannot teleport while pz locked!", 19) - player will get msg if pz lock
else
doTeleportThing(cid, truepos, TRUE) -- if no pz lock player gets teleported
doCreatureSay(cid, "Teleported!", 19) -- player will get msg when teleport happend
end
return true
end
local truepos = {x=351, y=198, z=7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayerPzLocked(cid) >= 1 then
doTeleportThing(cid, truepos, FALSE)
doCreatureSay(cid, "You cannot teleport while pz locked!", 19)
end
elseif isPlayerPzLocked(cid) < 0 then
doTeleportThing(cid, truepos, TRUE)
doCreatureSay(cid, "Teleported!", 19)
end
return true
end
I'm using tfs 0.2.10
So maybe not, I'm not sure. I'm having a lot of trouble with this, I just dont know how to use a different client or server or anything. :s