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

teleport player if no battle

labbadia

New Member
Joined
Aug 29, 2010
Messages
51
Reaction score
1
Hello..
I need one script to only teleport player if he is no battle(pvp)...to put this in a teleport!
Thanks!
 
u can use teleport scroll

Actions.xml add
Code:
	<action itemid="[COLOR="red"]1775[/COLOR]" event="script" value="tpscroll1.lua"/>
Change red to itemid of your scroll.
tpscroll1.lua
LUA:
--Script by Sonical
local newpos = {x=32247, y=33569, z=7} --New position
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
      doSendMagicEffect(getPlayerPosition(cid), 2)
      doTeleportThing(cid,newpos)
      doSendMagicEffect(newpos,10)
	  doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end
2. this one will tp him to his temple
LUA:
--Script by Sonical
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
      doSendMagicEffect(getPlayerPosition(cid), 2)
      doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
      doSendMagicEffect(newpos,10)
	  doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end

Rep++
 
Now... i undestand it...not i dont want teleport scroll ;x
i need it for get out of arena...i want one teleport script for check if players have baltte / pvp fight...can u do that?... i will rep u if u do
Thanks!
 
@up
He just want a simple stepin script for teleport that dosnt aloow players to be teleports if they have pz locked

@topic
sorry i am tooo busy to help out.
 
Bump+
i found that script... but it not working
can someone fix it for me plx?

notbattle.lua
function onStepIn(cid, item, position, fromPosition)

local config = {
battle = "yes", -- players deve estar sem battle ("yes" or "no")
msg_fail = "Você não pode passar por aqui com battle."
}

if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msg_fail)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
return TRUE
end


em movements.xml add tag:

<movevent type="StepIn" uniqueid="13710" event="script" value="notbattle.lua"/>

when i pass to the teleport with the unique id 13710...the message appear but dont work...the player can get out of the place!
 
LUA:
local pos = {x=1,y=1,z=1}
function onStepIn(cid, item, position, fromPosition)
if  hasCondition(cid, CONDITION_INFIGHT) == false then
  doTeleportThing(cid,pos)
else
doTeleportThing(cid,fromPosition)
doSendMagicEffect(getThingPos(cid),2)
doPlayerSendCancel(cid,"You cant enter when having a battle sign")
end
return true
end
Code:
<movevent type="StepIn" actionid="XXX" event="script" value="XXX.lua"/>
Put the action id(will be on the teleport) and the script name
 
Look what is happen
lookr.png

the message appear ...but it dont work...it teleport with battle!
Explain the image...
its one arena...with pvp tool there...teleport move to the exit (with protect zone tool and no pvp zone tool)
 
Back
Top