• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Teleport

Reaper7

dunno wat 2 rite here
Joined
Feb 18, 2011
Messages
133
Reaction score
1
Hello!
Today, I want to present you a short script, which teleports player, anywhere you like - position can always be changed, so if you want to play with my short code, I don't really mind, you're welcome to do it.

Ohh! I nearly forgott. I don't know who was first to write a script like that, surely it wasn't me, but I couldn't find any script like that here, so I've just added it. I know that it's easy to write it, but believe me that there are some people which don't know lua and to make something like that, might be for them a disaster. :)

data/talkactions/scripts/teleport.lua:
Code:
--[[
Script by Reaper7/Elff/xElf
]]-- 

function onSay(cid, words, param)
 
     if(isPlayerPzLocked(cid) == FALSE) then
     doTeleportThing(cid, {x = teleport[param].x, y = teleport[param].y, z = teleport[param].z})
     doSendMagicEffect(getCreaturePos(cid), 10)

     end 
end


data/talkactions/talkactions.xml - Then of course, add this:
Code:
<talkaction words="!teleport" script="teleport.lua"/>

Regards,
Reaper7
 
no, table with destinations is missing.
Code:
local teleport = {
	['chuj'] = {x=100, y=100, z=7},
	['ciota'] = {x=100, y=100, z=7},
}

function onSay(cid, words, param, channel)
	local s = teleport[param:lower()]
	if s then
		if not isPlayerPzLocked(cid) then
			doTeleportThing(cid, s)
			doSendMagicEffect(s, CONST_ME_TELEPORT)
		else
			doPlayerSendCancel(cid, 'You are PZlocked.')
		end
	else
		doPlayerSendCancel(cid, 'Destination doesn\'t exist.')
	end
	return true
end
 
sorry, I'm new in lua. next time, please change it without of using, any swear words (:
 
Back
Top