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

Say X on a time tile and get teleported to X

simkal

New Member
Joined
Jan 21, 2010
Messages
361
Reaction score
3
Say X on a time tile and get teleported to X
anyone cna help me=?
 
Last edited:
this script is with scroll
f0c9wz.jpg

PHP:
local scroll = 1949 --paper itemid
local places = {
	['trainers'] = {x=95,y=117,z=7},
	['temple'] = {x=200,y=100,z=7},
}

function onTextEdit(cid, item, newText)
	if item.itemid ~= scroll or getPlayerItemById(cid, true, scroll).uid ~= item.uid then
		return true
	end
	
	if isPlayerPzLocked(cid) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_PLAYERISPZLOCKED)
		return true
	end
	
	if isInArray({'locations','location','place','places'},newText:lower()) then
		local i = ''
		for j, k in pairs(places) do
			i = i .. ' [' .. j .. ']'
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can only write these locations to teleport: ' .. i)
		return true
	end
	
	if not places[newText:lower()] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Invalid location, write "locations" for more info.')
		return true
	end
	
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	doTeleportThing(cid, places[newText:lower()])
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	return true
end

PHP:
<event type="textedit" name="text" event="script" value="text.lua"/>

PHP:
registerCreatureEvent(cid, "text")
 
LUA:
function onSay(cid, words, param, channel)
	local p = getThingPos(cid)
	p.stackpos = 0
	local v = getThingfromPos(p).itemid
	if v >= 471 and v <= 474 then
		doTeleportThing(cid, {x=100, y=100, z=7})
		doSendMagicEffect(p, CONST_ME_TELEPORT)
		doSendMagicEffect({x=100, y=100, z=7}, CONST_ME_TELEPORT)
		return true
	end
end
 
bump

if no one understood:

IF the player stands on a time tile [X: 1004] [Y: 1000] [Z: 7] and he says Teleports he will be teleported to [X: 1042] [Y: 879] [Z: 7].
 
Back
Top