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

Script Help!

TheColt

New Member
Joined
Jul 31, 2011
Messages
82
Reaction score
2
Hi, I need a script for a tibia server 7.6 (xml)
The script will be for a quest.

First, the players will go throught some monsters and stuff like always, when they reach the final monster (the strongest one) they will need to kill it to get the reward, because the monster will loot a key.
I want to make it like annihilator, 4 (but i want to make it for 10) people step on a tile and then they use the switch to teleport (in this case they will teleport to the room with the rewards) but they need to put the key on a tile to make the switch work.
And also, is it possible that when the key is in the tile, even if the player tiles are not full by 10 players, it still works with the people who is there? imagine there are 3 people doing the quest, but there is space for 10, can it work no matter how many people do it?

Thanks (If you didn't understand I will try to explain again)
 
Well I use this script to teleport 13 people and I use it for TFS 0.4 so I have no idea if it will work in your case with your server.
Code:
local config = {

    players = {  --player pos
        {x=1022, y=1003, z=8, stackpos=253},
        {x=1022, y=1004, z=8, stackpos=253},
        {x=1022, y=1005, z=8, stackpos=253},
        {x=1022, y=1006, z=8, stackpos=253},
       
        {x=1023, y=1003, z=8, stackpos=253},
        {x=1023, y=1004, z=8, stackpos=253},
        {x=1023, y=1005, z=8, stackpos=253},
        {x=1023, y=1006, z=8, stackpos=253},
       
        {x=1024, y=1003, z=8, stackpos=253},
        {x=1024, y=1004, z=8, stackpos=253},
        {x=1024, y=1005, z=8, stackpos=253},
        {x=1024, y=1006, z=8, stackpos=253},
       
        {x=1020, y=1005, z=8, stackpos=253}},
       
    npos = {  -- new player pos
        {x=538, y=984, z=7},
        {x=538, y=985, z=7},
        {x=538, y=986, z=7},
       
        {x=539, y=984, z=7},
        {x=539, y=985, z=7},
        {x=539, y=986, z=7},
       
        {x=540, y=984, z=7},
        {x=540, y=985, z=7},
        {x=540, y=986, z=7},
       
        {x=541, y=984, z=7},
        {x=541, y=985, z=7},
        {x=541, y=986, z=7},
       
        {x=539, y=982, z=7}},
       
}

function onUse(cid, item, frompos, item2, topos)
    if item.itemid == 1945 then
        local tbl = {}
        for k, v in pairs(config.players) do
            local player = getThingfromPos(v)
            if(not isPlayer(player.uid)) then
                doPlayerSendCancel(cid, "You need 13 players for this quest.")
                return TRUE
            end
            table.insert(tbl, player.uid)
        end
        for i, v in ipairs(tbl) do
            doTeleportThing(v, config.npos[i])
            doSendMagicEffect(config.npos[i], 12)
            doSendAnimatedText(config.npos[i], "Go!", 192)
        end
       
        setGlobalStorageValue(6500, 0)
        return TRUE
    end

    return TRUE
end

And you are in the wring section, this should be in requests.
 
Well I use this script to teleport 13 people and I use it for TFS 0.4 so I have no idea if it will work in your case with your server.
Code:
local config = {

    players = {  --player pos
        {x=1022, y=1003, z=8, stackpos=253},
        {x=1022, y=1004, z=8, stackpos=253},
        {x=1022, y=1005, z=8, stackpos=253},
        {x=1022, y=1006, z=8, stackpos=253},
      
        {x=1023, y=1003, z=8, stackpos=253},
        {x=1023, y=1004, z=8, stackpos=253},
        {x=1023, y=1005, z=8, stackpos=253},
        {x=1023, y=1006, z=8, stackpos=253},
      
        {x=1024, y=1003, z=8, stackpos=253},
        {x=1024, y=1004, z=8, stackpos=253},
        {x=1024, y=1005, z=8, stackpos=253},
        {x=1024, y=1006, z=8, stackpos=253},
      
        {x=1020, y=1005, z=8, stackpos=253}},
      
    npos = {  -- new player pos
        {x=538, y=984, z=7},
        {x=538, y=985, z=7},
        {x=538, y=986, z=7},
      
        {x=539, y=984, z=7},
        {x=539, y=985, z=7},
        {x=539, y=986, z=7},
      
        {x=540, y=984, z=7},
        {x=540, y=985, z=7},
        {x=540, y=986, z=7},
      
        {x=541, y=984, z=7},
        {x=541, y=985, z=7},
        {x=541, y=986, z=7},
      
        {x=539, y=982, z=7}},
      
}

function onUse(cid, item, frompos, item2, topos)
    if item.itemid == 1945 then
        local tbl = {}
        for k, v in pairs(config.players) do
            local player = getThingfromPos(v)
            if(not isPlayer(player.uid)) then
                doPlayerSendCancel(cid, "You need 13 players for this quest.")
                return TRUE
            end
            table.insert(tbl, player.uid)
        end
        for i, v in ipairs(tbl) do
            doTeleportThing(v, config.npos[i])
            doSendMagicEffect(config.npos[i], 12)
            doSendAnimatedText(config.npos[i], "Go!", 192)
        end
      
        setGlobalStorageValue(6500, 0)
        return TRUE
    end

    return TRUE
end

And you are in the wring section, this should be in requests.
Thanks! I want to try it, but I have some questions because Im not very good with scripts, what ID should I put in the switch or in the key tile, and what key does it uses?
Again, thanks!
 
Thanks! I want to try it, but I have some questions because Im not very good with scripts, what ID should I put in the switch or in the key tile, and what key does it uses?
Again, thanks!

Use any action ID that is not used for the switch, leave the rest as is, just remember to change the coordinates.
 
Back
Top