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

"you can just enter this portal once"

Hmpfot

New Member
Joined
Apr 19, 2009
Messages
72
Reaction score
0
Hello mates!

Im looking for a script that makes it possible to just enter a teleport once, im doing a banshee quest on my 100% custom maded map and i want a portal that u just can enter once so u dont HUNT in there, you kno what i mean? so when you enter it first time it works then 2nd time u go in there it says

"you can only enter this portal once"

plz help me :)
 
Lua:
function onStepin(cid, item, position, fromPosition)
    if (getPlayerStorageValue(cid, 666) == -1) then
        setPlayerStorageValue(cid, 666, 1)
        return true
    end
    doTeleportThing(cid, fromPosition)
    doPlayerSendCancel("You can enter this portal only once!")
    return false
end
or smth like that
 
sry for being nooby but i dont kno a thing about this so i make a new LUA file with this? and what are thoose 666 numbers? :O dont i need to put X Y Z positions or smtn? and what means Cid haha alot of questions,

thx alot

Yours Hmpf~
 
sry for being nooby but i dont kno a thing about this so i make a new LUA file with this? and what are thoose 666 numbers? :O dont i need to put X Y Z positions or smtn? and what means Cid haha alot of questions,

thx alot

Yours Hmpf~

666 is the storage value the script sets, basically a variable that becomes declared. (This is flexible and can be anything.)
(cid) executes it. (What I learnt 2 years ago.

You save this as a .lua then I think you need to edit movements etc.
 
so, could u make me a correct scripts with so this script is being on the correct teleport? i can send ya the cordinates of the teleport if u like em :)
 
so, could u make me a correct scripts with so this script is being on the correct teleport? i can send ya the cordinates of the teleport if u like em :)
What?
I can't do LUA for shit, I only have basic knowledge in reading the scripts, never ever writing.
 
True in most...
cid - user
666 - storage id u can change it to another one but in both part of scripts
You must save it in movements/scripts and then add special line in movements.xml (i think u should do it yourself).
I think it should work without any positions just make them in tp in map editor, if it wont say that here.

@up Lulz down ;<
 
Change X Y Z to your positions and number of storage and It will work

Lua:
function onStepin(cid, item, position, fromPosition)
toposition = {X,Y,Z}

if getPlayerStorageValue(cid, 777) == -1 then
   setPlayerStorageValue(cid, 777, 1)
   doTeleportThing(cid, toposition)
else
   doTeleportThing(cid, fromPosition)
   doPlayerSendCancel("You can enter this portal only once!")
return false
end
 
Last edited:
Lua:
function onStepin(cid, item, position, fromPosition)
local toposition = {x = 1, y = 1, z = 7}
 
if getPlayerStorageValue(cid, 777) == -1 then
   setPlayerStorageValue(cid, 777, 1)
   doTeleportThing(cid, toposition)
   return false
end
doTeleportThing(cid, fromPosition)
doPlayerSendCancel("You can enter this portal only once!")
return false
end
U mean about that?
You didnt add end and did a global variable ;x
 
Lua:
function onStepin(cid, item, position, fromPosition)
local toposition = {x = 1, y = 1, z = 7}
 
if getPlayerStorageValue(cid, 777) == -1 then
   setPlayerStorageValue(cid, 777, 1)
   doTeleportThing(cid, toposition)
   return false
end
doTeleportThing(cid, fromPosition)
doPlayerSendCancel("You can enter this portal only once!")
return false
end
U mean about that?
You didnt add end and did a global variable ;x
Wait, he added an else, so it should've been like that only with the variable having to be local...
 
so i change CID to the CID the teleport have? and then i change the cordinates and then its done? and if i wanna chnage so u can enter it twice i just change the 1 and -1 to 2 and -2? :)
 
Forget, my script is working. I don't have to change nothing. :p
---------------------
Change X Y Z to your positions and number of storage and It will work

Lua:
function onStepin(cid, item, position, fromPosition)
toposition = {X,Y,Z}

if getPlayerStorageValue(cid, 777) == -1 then
   setPlayerStorageValue(cid, 777, 1)
   doTeleportThing(cid, toposition)
else
   doTeleportThing(cid, fromPosition)
   doPlayerSendCancel("You can enter this portal only once!")
return false
end
 
so i change CID to the CID the teleport have? and then i change the cordinates and then its done? and if i wanna chnage so u can enter it twice i just change the 1 and -1 to 2 and -2? :)

You don't need to change "cid", it's automatically redirected to the user and where he is standing, basically the script starts when "cid" (user) walks into the teleporter.

what does the 777 means i dont need to change that too? :p i tried to change and then it didnt worked

777 is the storage value, change it to smth like 5034
 
Why 5034? just wonder but i need the correct digits since with 777 it didnt worked, not 666 either or 1949 as the teleport CID is :S
 
"I CAN'T HERE U BLABLA IT'S WORKING BLA BLA BLA!!!".
Just think about it we r giving u an advice and u r ignoring.
Did u tested ur code?
Because u didnd gave last end(there is an end to close function but what with it [if -> else -> end]).
@author
use that
Lua:
function onStepin(cid, item, position, fromPosition)
local toposition = {x = 1, y = 1, z = 7} -- CONFIGURE JUST POSITION IN HERE!
 
if getPlayerStorageValue(cid, 32412) == -1 then
   setPlayerStorageValue(cid, 32412, 1)
   doTeleportThing(cid, toposition)
else
   doTeleportThing(cid, fromPosition)
   doPlayerSendCancel("You can enter this portal only once!")
end
return false
end
 
Back
Top Bottom