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

[HELP] Teleport Scroll not working on 8.54.

DanneZ

Web-Scripting-Design-Host
Joined
Jan 16, 2010
Messages
84
Reaction score
2
Location
Sweden
This script is made by Colandus.

Its Working 100% on my realmap 8.60 TFS 0.3.6 and on my 8.57 realmap also 0.3.6.
But when i use it on my 8.54 TFS 0.3.6 if u press one time nothing happends but when u press one more time it say "You have cancelled the teleport."

There is no Effect, teleporting or text exept when u cancel.

Here is the Script:
Code:
local countdown = 24
local name = "tempel"
 
local action = {}
 
local function teleport(p) 
	local cid, count = unpack(p)
	if(isPlayer(cid) == TRUE) then
		local cancelled = not action[cid]
		local playerPos = getCreaturePosition(cid)
		if(not cancelled) then 
			if(getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then 
				doPlayerSendTextMessage(cid, 21, "Teleport cancelled because of being in a fight!")

				cancelled = true
			elseif(count > 0) then
				doPlayerSendTextMessage(cid, 27, "Teleporting in " .. count .. " seconds.")
		doSendAnimatedText(getPlayerPosition(cid), "" .. count .. "", TEXTCOLOR_LIGHTBLUE) 
			
			        doSendMagicEffect(playerPos, CONST_ME_WATERSPLASH)
				addEvent(teleport, 1000, {cid, count - 1})
			else
				doTeleportThing(cid, getPlayerMasterPos(cid)) 
				doPlayerSendTextMessage(cid, 27, "Teleported to the " .. name .. ".")
				doSendAnimatedText(getPlayerPosition(cid), "Escaped!", TEXTCOLOR_RED) 
				
 
				local playerPos = getCreaturePosition(cid)
				doSendMagicEffect(playerPos, CONST_ME_FIREATTACK)
				doSendMagicEffect(playerPos, CONST_ME_FIREAREA)
 
				action[cid] = false
			end
		end
 
		if(cancelled) then
			doSendAnimatedText(playerPos, "Cancelled", TEXTCOLOR_RED)
			action[cid] = false
		end
	end
end 
 
function onUse(cid, item, ppos, frompos, item2, playerPos)
	local countdown = countdown * (isPremium(cid) == TRUE and 0.25 or 1) -- remove this line if you don't want premium multiplier
 
	if(getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot use a teleport scroll when you are in a fight.") 
	elseif(action[cid]) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have cancelled the teleport.") 
		action[cid] = false
		return TRUE
     
	
	else
		action[cid] = true
		teleport({cid, countdown})
		
	end
 
	if(action[cid] == false) then
		doSendMagicEffect(frompos, CONST_ME_POFF)
	end
	return TRUE 
end

Rep++ if you help.
Thanks for ur time, Yours DanneZ.
 
GRRRR U dont telling me about ur project...

Lua:
local function doTeleport(cid, count)
	if not isPlayer(cid) then
		return true
	end
	doSendAnimatedText(getThingPos(cid), 5 - count..'s', COLOR_ORANGE)
	doSendMagicEffect(getThingPos(cid), CONST_ME_YELLOW_RINGS)
	if count == 5 then
		return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, {x=1000,y=1000,z=7}) and doCreatureSay(cid, 'You have been teleported to temple', TALKTYPE_ORANGE_1, false, cid)
	else
		addEvent(doTeleport, 1000, cid, count + 1)
	end
	return true
end

function onCastSpell(cid, var)
	if getCreatureSkullType(cid) > SKULL_GREEN or isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_INFIGHT) then
		doPlayerSendCancel(cid, 'You cannot use this spell while you got pz mark on, nor if you are skulled.')
	else
		return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
	end
end



Spells.xml

<instant name="City Teleport" words="exana home" lvl="20" mana="100" aggressive="0" selftarget="1" exhaustion="5000" needlearn="0" event="script" value="citytp.lua">
<vocation id="1-8"/>
</instant>
 
Back
Top