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

Tp Scroll/Magic Scroll...

norse123

Member
Joined
Jun 26, 2010
Messages
1,193
Reaction score
19
Hey,
Could someone create me a Tp Scroll and a Magic scroll for TFS 0.3.6pl1?


About the items what they should do , TP scroll i want it to tp u to the temple but u cant use it while u are in battle and when u use the tp scroll it counts from 10 to 0 then it takes u to temple.

And the Magic scroll is that i want a scroll that gives xxx magic lvls...

Please Help me someone:D
Rep+++
Regards,
Norse
 
if so, here is it
Code:
local cfg = {
	time = 10, -- Time the teleport is open.
	exhausted = 60, -- Time you are exhausted.
	storage = 1337, -- Storage used for "exhaust."
	to = { x = 1000, y = 1000, z = 7 } -- Where the teleport takes you.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, cfg.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, cfg.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, cfg.storage) - os.time()) == 1 and "" or "s") .. " to create another teleport.")
	elseif(getTilePzInfo(getCreaturePosition(cid)) == true) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport in a protection zone.")
	elseif(hasProperty(getThingFromPos(toPosition).uid, CONST_PROP_BLOCKSOLID) == true) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport here.")
	else
		local function deleteTeleport()
			local teleport = getTileItemById(toPosition, 1387).uid
			if(teleport > 0) then
				doRemoveItem(teleport)
				doSendMagicEffect(toPosition, CONST_ME_POFF)
				doSendAnimatedText(toPosition, "Closed", TEXTCOLOR_RED)
			end
			return true
		end
		for x = 1, cfg.time do
		local n = cfg.time - x
			addEvent(doSendAnimatedText, x * 1000, toPosition, n > 0 and tostring(n), TEXTCOLOR_WHITE)
		end
		doCreateTeleport(1387, cfg.to, toPosition)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
		addEvent(deleteTeleport, cfg.time * 1000)
		setPlayerStorageValue(cid, cfg.storage, os.time() + cfg.exhausted)
	end
	return true
end
 
i think is JDB... lol -dont remember- or maybe Cykotitan - i have that script for like 5 months ;p i use on my serv
 
@up, I already got the script that makes a teleport on the floor and dissapear but i dont want that scrpt.
I want a Tp Scroll that u right click on when ur not on pz and then it counts from 10-0 then u teleports to temple.
If your in battle u cant use the teleport.
 
Here is my old script (although you will need to replace the exhaust system):
Lua:
-- By Colandus LEAVE CREDITS

local countdown = 60
local name = "Your Temple"

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
				doCreatureSay(cid, "Teleporting in " .. count .. " seconds.", TALKTYPE_ORANGE_1)
				doSendAnimatedText(playerPos, "Teleport", TEXTCOLOR_RED)
				doSendMagicEffect(playerPos, CONST_ME_FIREATTACK)
				addEvent(teleport, 1000, {cid, count - 1})
			else
				doTeleportThing(cid, getPlayerMasterPos(cid)) 
				doPlayerSendTextMessage(cid, 21, "Teleported to the " .. name .. ".")
				doSendMagicEffect(playerPos, CONST_ME_ASSASSIN) 
				
				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, topos)
	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
	elseif(isExhausted(cid, 9143, countdown * 4) == 1) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The power of this scroll is too strong to be executed this fast.") 
	else
		action[cid] = true
		teleport({cid, countdown})
		setExhaust(cid, 9143)
	end
	
	if(action[cid] == false) then
		doSendMagicEffect(frompos, CONST_ME_POFF)
	end
	return TRUE 
end
 
This for only 1 ussage:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid, 4650,-1) then
  doPlayerAddMagLevel(cid, 2)
  doPlayerSendCancel(cid, "Congratulations you win 2 magic level.")
   doRemoveItem(item.uid, 1)
else
  doPlayerSendCancel(cid, "You already recieve this reward.")
   end
 end
And this are limited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
  doPlayerAddMagLevel(cid, 2)
  doPlayerSendCancel(cid, "Congratulations you win 2 magic level.")
   end
 end


REP++
 
No sorry no work this said:

[Error - LuaScriptInterface::loadFile] data/actions/scripts/magic2.lua:8: '<eof>' expected near 'end'
[27/11/2010 12:54:46] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/magic2.lua)
[27/11/2010 12:54:46] data/actions/scripts/magic2.lua:8: '<eof>' expected near 'end'
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
if getPlayerStorageValue(cid, 4650,-1) then
  doPlayerAddMagLevel(cid, 2)
  doPlayerSendCancel(cid, "Congratulations you win 2 magic level.")
   doRemoveItem(item.uid, 1)
else
  doPlayerSendCancel(cid, "You already recieve this reward.")
   end
 end
end
 

Similar threads

Back
Top