• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Teleport Scroll tfs 1.0

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello I have problem with teleport scroll script... :<

My script

local newpos = {x=1000, y=1000, z=7}
local time = 1--in second
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1605) then
return doPlayerSendCancel(cid, "Please Wait "..exhaustion.get(cid,1605)..".") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

if not inFight then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doCreatureSay(cid, "TELEPORTED!!" ,25)
exhaustion.set(cid, 1605, time)

else
doPlayerSendTextMessage(cid,25,"You can't use the teleport scroll if you are PZ LOCKED!!")
end
return true
end



I have error
lua 4 attempt to call global 'has condition' (a ni value)

Can anybody fix it for me??? :<


Thanks for help and rep+ :)
 
try:
Code:
local newpos = {x=1000, y=1000, z=7}
local time = 1--in second
function onUse(cid, item, fromPosition, itemEx, toPosition)
local inFight = getCreatureCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1605) then
return doPlayerSendCancel(cid, "Please Wait "..exhaustion.get(cid,1605)..".") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

if not inFight then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doCreatureSay(cid, "TELEPORTED!!" ,25)
exhaustion.set(cid, 1605, time)

else
doPlayerSendTextMessage(cid,25,"You can't use the teleport scroll if you are PZ LOCKED!!")
end
return true
end
 
try:
Code:
local newpos = {x=1000, y=1000, z=7}
local time = 1--in second
function onUse(cid, item, fromPosition, itemEx, toPosition)
local inFight = getCreatureCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1605) then
return doPlayerSendCancel(cid, "Please Wait "..exhaustion.get(cid,1605)..".") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

if not inFight then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doCreatureSay(cid, "TELEPORTED!!" ,25)
exhaustion.set(cid, 1605, time)

else
doPlayerSendTextMessage(cid,25,"You can't use the teleport scroll if you are PZ LOCKED!!")
end
return true
end



Techrlz that script dont work :/, no error but when I use it I have Tibia client Debug :/
 
Use constant names for text messages and magic effects if you want to avoid client debugs.

e.g
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, "TELEPORTED!!", TALKTYPE_ORANGE_1)
 
It uses function onUse, which means it's an action script, you add it in data/actions/scripts and in actions.xml.
How exactly in actions.xml depens on which server you use (script or event and value), but you can also just look at other xml lines for examples.
 
It uses function onUse, which means it's an action script, you add it in data/actions/scripts and in actions.xml.
How exactly in actions.xml depens on which server you use (script or event and value), but you can also just look at other xml lines for examples.

so im useing the data pack by printer tfs 1.0 real map and i want to make premium scroll the teleport scroll.
 
Code:
<action itemid="16101" script="other/teleportscroll.lua"/>
As you can see it's added on the same way as other items that are added with itemid in actions.xml, only thing you have to do is change the itemid and script name.
 
33o1fev.png


geting this error
 
Back
Top