• Vote in May Mapping Competition to select a winner!
  • 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!

(TFS 1.0) Looking for All Addons and Mounts at Log in. Lua

CesarZ

Member
Joined
Sep 20, 2012
Messages
82
Best answers
0
Reaction score
8
Make sure it works for TFS 1.0. Give me the details to install it properly. Thanks guys!
 

Sparkles

snek
Joined
Mar 1, 2009
Messages
285
Best answers
24
Reaction score
122
Location
Norway, Tromsø
I dont know what version of Tibia TFS 1.0 is running (what outfits and mounts exist), but I took these outfits and mounts from TFS 1.3.
You can check and see what outfits your TFS has in data/xml/outfits.xml, which are the ones listed in outfits = {} and then just remove the ones you dont have.

Same goes for mounts, but then you just change the mounts number to the last mount id located at data/xml/mounts.xml

Here you can see where I got the number 102 from: otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/data/XML/mounts.xml#L104)

And then you just place the code below in data/events/scripts/player.lua, at the bottom of the file.
Then reload events, or restart server and login.
Lua:
local outfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156,
157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471, 513, 514,
542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696, 698, 724, 732, 745, 749,
759, 845, 852, 874, 885, 900, 128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151,
152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 697, 699, 725, 733, 746,
750, 760, 846, 853, 873, 884, 899}
local mounts = 102

function onLogin(player)
    if player:getStorageValue(52324) < 1 then
        for i = 1, mounts do
            player:addMount(i)
        end
        for i = 1, #outfits do
            player:addOutfit(outfits[i])
            player:addOutfitAddon(outfits[i], 3)
        end
        player:setStorageValue(52324, 1)
    end
    return true
end
 
Last edited:
OP
CesarZ

CesarZ

Member
Joined
Sep 20, 2012
Messages
82
Best answers
0
Reaction score
8
I added it on player.lua. It doesn't work. or maybe is missing something??
 

Sparkles

snek
Joined
Mar 1, 2009
Messages
285
Best answers
24
Reaction score
122
Location
Norway, Tromsø
I added it on player.lua. It doesn't work. or maybe is missing something??
Do you have any errors?
Do you get the mounts and not the outfits?
Do you get the addons?
Do you have all the outfits unlocked for everyone to use?
Is free premium set in config.lua?

Just saying it doesnt work does not tell me anything :oops:
 
OP
CesarZ

CesarZ

Member
Joined
Sep 20, 2012
Messages
82
Best answers
0
Reaction score
8
I get no error either the mounts nor the outfits. I put it all the way at the bottom of the script. Of player.lua. its like it didnt do nothing. I pasted at the. Bottom after the "end"
Post automatically merged:

I got free premmy setup in my configuration also
 

cocacola13

Premium User
Premium User
Joined
Jan 18, 2019
Messages
109
Best answers
0
Reaction score
2
and did you create a new character? if not create a new character and try
 
OP
CesarZ

CesarZ

Member
Joined
Sep 20, 2012
Messages
82
Best answers
0
Reaction score
8
Yea i did created a new character. It's weird because I added this Script, it didn't came up with any error but it doesn't work. it's like i placed it in the wrong spot and it's not even detecting itplayer lueee.JPG
 

Sparkles

snek
Joined
Mar 1, 2009
Messages
285
Best answers
24
Reaction score
122
Location
Norway, Tromsø
Lua:
function onLogin(cid)
local player = Player(cid)
local outfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156,
157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471, 513, 514,
542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696, 698, 724, 732, 745, 749,
759, 845, 852, 874, 885, 900, 128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151,
152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 697, 699, 725, 733, 746,
750, 760, 846, 853, 873, 884, 899}
local mounts = 102

    if player:getStorageValue(52325) < 1 then
        for i = 1, mounts do
            player:addMount(i)
        end
        for i = 1, #outfits do
            player:addOutfit(outfits[i])
            player:addOutfitAddon(outfits[i], 3)
        end
        player:setStorageValue(52325, 1)
    end
    return true
end
Try this maybe.
 
Last edited:

Evil Puncker

its just a flu
TFS Developer
Premium User
Joined
May 30, 2009
Messages
6,571
Best answers
74
Reaction score
2,275
And then you just place the code below in data/events/scripts/player.lua, at the bottom of the file.
Then reload events, or restart server and login.
shouldn't this creeatureevent script be placed at creatureevent script folder and xml? or tfs 1.0 didn't had it yet? 🤔
 

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,249
Best answers
224
Reaction score
1,217
Location
Sweden
shouldn't this creeatureevent script be placed at creatureevent script folder and xml? or tfs 1.0 didn't had it yet? 🤔
Correct but no need to do anything in XML since all the TFS distros I know have a creaturescripts folder and a login.lua (not something new from 1.x)
Just paste it below this:
Lua:
local player = Player(cid)
 
OP
CesarZ

CesarZ

Member
Joined
Sep 20, 2012
Messages
82
Best answers
0
Reaction score
8
Nothing yet. not error no nothing. :S im running 10.41 client on TFS 1.0

Should i be adding anything on the Event.XML?lll.JPG
 
Last edited:

Boy67

Active Member
Joined
Jul 4, 2007
Messages
161
Best answers
3
Reaction score
32
Location
England
Paste this below line 3 of that file:

Lua:
local outfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156,
157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471, 513, 514,
542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696, 698, 724, 732, 745, 749,
759, 845, 852, 874, 885, 900, 128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151,
152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 697, 699, 725, 733, 746,
750, 760, 846, 853, 873, 884, 899}
local mounts = 102

if player:getStorageValue(52325) < 1 then
    for i = 1, mounts do
        player:addMount(i)
    end
    for i = 1, #outfits do
        player:addOutfit(outfits[i])
        player:addOutfitAddon(outfits[i], 3)
    end
    player:setStorageValue(52325, 1)
end
 

Sparkles

snek
Joined
Mar 1, 2009
Messages
285
Best answers
24
Reaction score
122
Location
Norway, Tromsø
Paste this below line 3 of that file:

Lua:
local outfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156,
157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471, 513, 514,
542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696, 698, 724, 732, 745, 749,
759, 845, 852, 874, 885, 900, 128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151,
152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 697, 699, 725, 733, 746,
750, 760, 846, 853, 873, 884, 899}
local mounts = 102

if player:getStorageValue(52325) < 1 then
    for i = 1, mounts do
        player:addMount(i)
    end
    for i = 1, #outfits do
        player:addOutfit(outfits[i])
        player:addOutfitAddon(outfits[i], 3)
    end
    player:setStorageValue(52325, 1)
end
Way to go swoop in at the last second with my script <3
 

Boy67

Active Member
Joined
Jul 4, 2007
Messages
161
Best answers
3
Reaction score
32
Location
England
Way to go swoop in at the last second with my script <3
Sorry dude, the credit is definitely yours. I would never claim any script was mine unless I specify it.

Also, if i said to add your script to that login.lua, I am pretty sure the OP would add the unnecessary parts and not integrate properly, leading to another post with "end" script errors etc xD
 
Last edited:
OP
CesarZ

CesarZ

Member
Joined
Sep 20, 2012
Messages
82
Best answers
0
Reaction score
8
Thanks all of you guys it worked i will post the script just for other people that need this can see what works.

Tested with TFS 1.0, Tibia 10.41 client Worked! All addons and Outfit at login.. Thanks for the help guys.

This is the script.
Code:
local outfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156,
157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471, 513, 514,
542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696, 698, 724, 732, 745, 749,
759, 845, 852, 874, 885, 900, 128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151,
152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 697, 699, 725, 733, 746,
750, 760, 846, 853, 873, 884, 899}
local mounts = 102

if player:getStorageValue(52325) < 1 then
    for i = 1, mounts do
        player:addMount(i)
    end
    for i = 1, #outfits do
        player:addOutfit(outfits[i])
        player:addOutfitAddon(outfits[i], 3)
    end
    player:setStorageValue(52325, 1)
end



This is how i put it in creaturescript/script/login.lua
Code:
function onLogin(cid)
    local player = Player(cid)
        local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
   
    local outfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156,
157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471, 513, 514,
542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696, 698, 724, 732, 745, 749,
759, 845, 852, 874, 885, 900, 128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151,
152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 697, 699, 725, 733, 746,
750, 760, 846, 853, 873, 884, 899}
local mounts = 102

if player:getStorageValue(52325) < 1 then
    for i = 1, mounts do
        player:addMount(i)
    end
    for i = 1, #outfits do
        player:addOutfit(outfits[i])
        player:addOutfitAddon(outfits[i], 3)
    end
    player:setStorageValue(52325, 1)
end
   
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. " Please choose your outfit."
        player:sendOutfitWindow()
   
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
            doCreatureSay(cid, "Welcome", TALKTYPE_ORANGE_1)
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
        end

        loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
    end
    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

    player:registerEvent("PlayerDeath")
    player:registerEvent("LevelLock")
    player:registerEvent("player")
    return true
end
 
Top