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

Talkactions teleport!

Ussef

New Member
Joined
May 27, 2009
Messages
123
Reaction score
2
Okay i need help with making a script! i need to make a talkaction script that teleports me. so for example!!!!


local standPos = {x=585,y=937,z=7} local newPos = {x=584,y=887,z=7} function onSay(cid, param) if comparePos(getPlayerPosition(cid), standPos) then doSendMagicEffect(getPlayerPosition(cid), 2) doTeleportThing(cid, newPos) doSendMagicEffect(newPos, 10) end return 1 end



if ur standing in a spot and say certain words you get teleported by the positions specified. now i tried this script but it wont work... can anyone help me!?
 
im pretty sure u got the wrong forum bro ^.^ anyway, here ya go.

put in talkactions/scripts :
LUA:
local teleportpos = {x=70,y=70,z=7} -- just change this to change the pos
function onSay(cid, item, fromPosition, itemEx, toPosition)
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, teleportpos)
end
return true

add to talkactions.xml :
LUA:
<talkaction words="!teleport" script="teleport.lua" />

Repp me if it helped
 
Last edited:
hey dude thanks! but i need to make it that u teleport from a certain position. the one u made me works but i teleport from anywhere. i want it if i am in a certain location i teleport to that location
 
LUA:
local teleportpos = {x=70,y=70,z=7} -- where you need to be to be tped
local teleporter = {x=80,y=80,z=7} -- where you will spawn after command
function onSay(cid, item, fromPosition, itemEx, toPosition)
doRelocate(teleportpos, teleporter)
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return true

ahh sorry should have read more carefully

use the script above

- - - Updated - - -

tested
 
thanks mate ur a life saver

- - - Updated - - -

dude one more thing would mean the world for me if u can help with this. so i made this script
local teleportpos = {x=782,y=648,z=7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemid == 9531 then
doTeleportThing(cid, teleportpos)
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return TRUE
end

once u click on something it teleports u to that location. how do i make it have a lvl requirement. sorry dude im new to this!!!
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
teleportpos = {x=782,y=648,z=7},
playerlevel = getPlayerLevel(cid),
requiredlevel = xx -- change this to the level requirement that you want
}
    if itemEx.itemid == 9531 then
         if config.playerlevel >= config.requiredlevel then
             doTeleportThing(cid, config.teleportpos)
             doSendMagicEffect(getPlayerPosition(cid), 2)
         else
             doCreatureSay(cid, "You need to be level "..config.requiredlevel.." or higher to use this item.", TALKTYPE_MONSTER)
             doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
             return 1
         end
    end
    return TRUE
end
You are welcome.
 
Back
Top