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

The Teleport

Status
Not open for further replies.

Kedor

New Member
Joined
Mar 3, 2008
Messages
263
Reaction score
0
Location
Poland, Gdynia
how can i make somethink like that
when i step into Teleport.. the teleport dissappear
and item on position x=1,y=1,z=1 dissappear too?:
 
On movements\movements.xml add:
Code:
<movevent event="StepIn" uniqueid="[B][COLOR=Red]xxxx[/COLOR][/B]" script="customteleport.lua" />
Edit xxxx to the uniqueid that you have on the map.

The customteleport.lua:
Code:
local oldPos = {x = [B][COLOR=Red]xxx[/COLOR][/B], y = [B][COLOR=Red]yyy[/COLOR][/B], z = [B][COLOR=Red]zz[/COLOR][/B]} -- teleport position
local newPos = {x = [B][COLOR=Red]xxx[/COLOR][/B], y = [B][COLOR=Red]yyy[/COLOR][/B], z = [B][COLOR=Red]zz[/COLOR][/B]} -- position where the player will be teleported

local itemPos = {x = [COLOR=Red][B]xxx[/B][/COLOR], y = [B][COLOR=Red]yyy[/COLOR][/B], z = [B][COLOR=Red]zz[/COLOR][/B], stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} -- position where the item need to be
local itemId = [B][COLOR=Red]xxxx[/COLOR][/B] -- item id (the item that need to disapear)

function onStepIn(cid, item, pos)

local getItem = getThingfromPos(itemPos)

    if isPlayer(cid) == TRUE then
        if getItem.itemid == itemId then
            doSendMagicEffect(oldPos, CONST_ME_POFF)
            doTeleportThing(cid, newPos, TRUE)
            doSendMagicEffect(newPos, CONST_ME_TELEPORT)
            doRemoveItem(getItem.uid)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The teleport isn't activated.")
            doSendMagicEffect(oldPos, CONST_ME_POFF)
        end
    end
    return TRUE
end

Edit what are in red :thumbup:
 
:*** thanks :) you helped me much :D not only with that.. but i need 1 think more..

when i step into teleport
-wall will appear at xx,yy,zz
-teleport will dissappear
-swich at xxx,yyy,zzz will change IDs from 1946 to 1945 :P
 
so where u come out at u want a wall to appear??? for teleport to dissappear do DecayTo (i think) and just make a lever script saying


WhenCharacterPullsLever(item id for lever)
then
change itemid of teleport
to (blank)

thats just a sloppy script lol just givving an idea
 
i just want somethink like on DHQ.. when i pull the lever teleport apper and wall dissappear.. i made it solo xD
but now i need that when i will step in teleport .. i want whole (maybe not monsters) DHQ be like before i entered there
no teleport
wall is in its place
and the swich is again 1945 so i can pull it and tp will appear etc etc :D understand me? :P
 
Look.. There is a DHQ...
when you tp to that room and you kill all monsters there.. you
Pull swich right?
then it change ID from 1945 to 1496
when you pull it.. the wall blocking way to chests dissappear and teleport appear in room so i am able to leave it..
and i need somehtink like

when i step into that created tp:
-swich ID will be again 1945 (so i need doTransformItem i think but i dont know how to make it)
-i want wall appear in same place it was to block the way to chests again
-and i want that teleport to dissappear (the one i can create with swich) so no1 will be able to leave room fast till he wont kill all or die :)


NOW ANY1 UNDERSTAND BLX? XD
 
Status
Not open for further replies.
Back
Top