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

Solved Random teleport trainer rooms

AnarchGov

Member
Joined
Oct 3, 2011
Messages
263
Reaction score
6
I am looking for a script that will teleport a player into a random training room of his own, unless it is already taken by someone else. Obviously i have done the mapping i am just looking for the script. Does anyone know where i can find it?

Basically like the training system on Noxious. Ill REP++ you.

<3

SOLVED: The script below is what i was looking for. I think the rest is self explanatory.
 
Last edited:
A lot of servers is using this, could be the script that you're looking for.

Lua:
function onStepIn(cid, item, position, fromPosition)
    for i = 17000, 17122 do
        local pos = getThingPos(i)
        if not isPlayer(getTopCreature(pos).uid) then
            doTeleportThing(cid, pos)
             doCreatureSay(cid, 'Using a tool to cast spells or to keep your character online is ok.', TALKTYPE_ORANGE_1, false, cid)
            doSendMagicEffect(position, CONST_ME_TELEPORT)
            doSendMagicEffect(pos, CONST_ME_TELEPORT)
            break
        end
    end
    doTeleportThing(cid, fromPosition, true)
    doCreatureSay(cid, 'All training slots are taken', TALKTYPE_ORANGE_1, false, cid)
    doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
 
You don't need to write in their positions, only UID's on the tiles where they should stand is needed.
 
Create a teleport with UID 1234 for example.
XML:
<movevent type="StepIn" uniqueid="1234" event="script" value="trainingroom.lua" />

Next thing to do is setting out UID's on the tiles where the player should stand after he or she gets teleported.

If you take a look at the picture, UID should be set in the middle. I hope you get the idea.

3OKto.png


Send me a Private Message if you need any further help with this.
 
Last edited:
Yeah i get it but what i am a little confused about is what this part of the script represents:

for i = 17000, 17122 do

Thanks!

- - - Updated - - -

[25/02/2013 01:58:30] The Governor has logged in.
[25/02/2013 01:59:02] [Error - MoveEvent::executeStep] Call stack overflow.

When i went through the teleport the second time it debugged my character and gave me that error on the consol. The first time i went through it it worked.
 
[25/02/2013 01:59:02] [Error - MoveEvent::executeStep] Call stack overflow.



Got the same error! Tibia crashes. Bump!
 
i don't have erro but script don't work
<movevent type="StepIn" uniqueid="5558" event="script" value="trainingroom.lua" />
and i set uniqued id in traning spot :S start at 17001-17006 for task only
i use tfs 0.4-dev
 
How did you added it in the map, did you added uniqueid 5558 to the teleport or tile to enter the training places? What happens, do you get errors?
 
Make sure the uniqueids are not added more than once, if you add the same uniqueid more than 1x you will get this error and your client will debug.
 
Do you get an error about duplicate uniqueid in your console? Try to use other uniqueids incase some are double and make sure all uniqueids in the script are used 1x.
 
ok so mine when i try to to enter the tp it just says all slots are filled with players.. i have 3000 UID set to the 1 portal then the spots i have for the first one UID 3001, then UID 3002 etc~~
 
ok so mine when i try to to enter the tp it just says all slots are filled with players.. i have 3000 UID set to the 1 portal then the spots i have for the first one UID 3001, then UID 3002 etc~~
Same goes with me !!
and about the " for i = 17000, 17122 do " i think it can't hold more than 3 uniqueid

using tfs 0.4 rev 3884 by the way !!

* Any help from the technical team * @Ninja
 
Last edited:
Back
Top