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

Lua teleport scroll

elementck

New Member
Joined
Jan 27, 2010
Messages
22
Reaction score
0
hello today Otland
I bring a problem is rather small and is not to bother them so much and helped me see that I am an unique in the published errors SUPPORT look good XD I have a teleport scroll and miss and it works great but the prolema bn is that when the player has pk and has bone pcs red swords that I hit sack any player or pc pk likewise can also use the scroll and I want does not happen so that if you have pcs pk or otherwise use the scroll I hope I understand and that if no pc and no pk can use this is the scrip.

function onUse(cid, item, frompos, item2, topos)
local telepos = {x=32353, y=32225, z=7}
ppos = getPlayerPosition(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, telepos, TRUE)
doSendMagicEffect(ppos,13)
doSendAnimatedText(frompos,'Para el depot',251)
else
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(ppos,2)
end
return 1
end

thanks to whom I can collaborate
 
Last edited:
LUA:
getCreatureCondition(cid, CONDITION_INFIGHT) == true

checks if is in combat.


edit: your code aldready checks if player isn't in combat, so what exactly is the problem?
 
LUA:
getCreatureCondition(cid, CONDITION_INFIGHT) == true

checks if is in combat.


edit: your code aldready checks if player isn't in combat, so what exactly is the problem?

lay men and true noo with or without pc pc will not let me carry me as if I get ever so pc or pk does not have it: S

- - - Updated - - -

Wrong forum (::
if it is worth wey I'm on every forum I aver that forum can help bone that forum knows more about this subject
 
if pz

LUA:
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), TRUE)
end
return true
end

if pz or in combat

LUA:
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), TRUE)
end
return true
end
 
if pz

LUA:
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), TRUE)
end
return true
end

if pz or in combat

LUA:
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), TRUE)
end
return true
end

this code. lua where bone sends you delete everything and put it and where you want it sends it to the coordinates that are in my scrip
 
I was thinking you wanted the player to teleport to the temple.

LUA:
local telepos = {x=32353, y=32225, z=7}
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, telepos, TRUE)
end
return true
end

LUA:
local telepos = {x=32353, y=32225, z=7}
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, telepos, TRUE)
end
return true
end
 
I was thinking you wanted the player to teleport to the temple.

LUA:
local telepos = {x=32353, y=32225, z=7}
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, telepos, TRUE)
end
return true
end

LUA:
local telepos = {x=32353, y=32225, z=7}
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doSendMagicEffect(getPlayerPosition(cid),2)
else
doTeleportThing(cid, telepos, TRUE)
end
return true
end

wey hey seriously thank you very much you helped me a lot mm tell me how I can reward and tell me how I can finally put to the scroll that you can use it after re-use in a minute and say something when you use many thanks and tell me how you I can reward
 
idk this one but try this

LUA:
local telepos = {x=32353, y=32225, z=7}
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) or (exhaustion.check(cid, 101) == true) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doPlayerSendCancel(cid, "Cooldown:[" ..exhaustion.get(cid, 101).."]")
doSendMagicEffect(getPlayerPosition(cid),2)
elseif not exhaustion.check(cid, 101) then
exhaustion.set(cid, 101, 60)
doSendAnimatedText(frompos,'Para el depot', 251) -- text when using scroll
doTeleportThing(cid, telepos, TRUE)
end
return true
end

tell me how I can reward

rep or whatever


edit: updated code, this should work.
 
Last edited:
idk this one but try this

LUA:
local telepos = {x=32353, y=32225, z=7}
function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) or (exhaustion.check(cid, 101) == true) then
doPlayerSendCancel(cid,"Tienes Pz Noob Esperate.")
doPlayerSendCancel(cid, "Cooldown:[" ..exhaustion.get(cid, 101).."]")
doSendMagicEffect(getPlayerPosition(cid),2)
elseif not exhaustion.check(cid, 101) then
exhaustion.set(cid, 101, 60)
doSendAnimatedText(frompos,'Para el depot', 251) -- text when using scroll
doTeleportThing(cid, telepos, TRUE)
end
return true
end



rep or whatever


edit: updated code, this should work.
man is still not exhausted the problem is coming out atackar enpiesan to the players with pk and buelan and haci lauriarlos do that to that one and two of which can be used continuously put a serious bone minute can not use that take white expadas lasts 30 seconds so that it can use
 
It works, I tested it.

Use your table & change line 19 to table variable.

LUA:
function telePortCountDown(number, pos, effect, msgonend, effectonend)
  local n = number
       for i = 1, number do
           addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
		   addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )
              n = n -1
	   end
return true
end


function onUse(cid, item, frompos, item2, topos)
if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) or (exhaustion.check(cid, 77101) == true) then
doCreatureSay(cid,"You cannot use this item shortly after a fight!",19)
--doCreatureSay(cid, "Cooldown:[" ..exhaustion.get(cid, 77101).."]",19)
doSendMagicEffect(getPlayerPosition(cid),2)
elseif not exhaustion.check(cid, 77101) then
doCreatureSetNoMove(cid, 1)
addEvent(doTeleportThing,10000,cid,getTownTemplePosition(getPlayerTown(cid)),FALSE)
addEvent(doCreatureSetNoMove,10000,cid, 0)
addEvent(doSendMagicEffect,10004,getTownTemplePosition(getPlayerTown(cid)), 10)
exhaustion.set(cid, 77101, 60)
telePortCountDown(10, getThingPos(cid), 5, "Teleport!", 2)
end
return true
end
 
Back
Top