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

Addon script tfs 1.2

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi folks! Why this script is not working? Does not give any kind of error

Code:
local config = {
        [0] = {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},
        [1] = {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}
    }

    local outfit = config[player:getSex()]
    if player:getStorageValue(6584) < 1 then
        for _, i in #outfit do
            player:addOutfitAddon(i, 3)
            player:setStorageValue(6584, 1)
        end
    end

Also, I'm using the script below that suppost to back players to level 190 if is higher than, but is not working.. Can someone help me with that?

Code:
if player:getLevel() > 190 then
        player:removeExperience(getExpForLevel(190) - player:getExperience(), false)
    end

Thanks.
 
Last edited:
Try using a couple of prints.. see how far into the script it's reading.

Tryed use..

Code:
local config = {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}
for a, b in ipairs(config) do
    print(a.." = "..b)
end

and the results is

iHH6wVm.png
 
Tryed use..

Code:
local config = {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}
for a, b in ipairs(config) do
    print(a.." = "..b)
end

and the results is
I meant like this. :p
Code:
local config = {
         [0] = {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},
         [1] = {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}
     }
     print(1)
     local outfit = config[player:getSex()]
     if player:getStorageValue(6584) < 1 then
       print(2)
         for _, i in #outfit do
             player:addOutfitAddon(i, 3)
             player:setStorageValue(6584, 1)
         end
     end
and you should move the player:setStorageValue outside of the loop
 
@Xikini
It's working now, I'm actually using for i = 1, #outfit do and removed the getSex.. Now I just need help with the second part..

The script above is suppost to back players to level 190 if is higher than, but is not working
 
Well I dunno what the 'false' does.. but for arguements sake.. let's say level 190 = 100 exp

so your doing this
player:removeExperience(getExpForLevel(190) - player:getExperience(), false)

player:removeExperience(100 - 200, false)

which equals a negative number.. and is most likely the reason it's not functioning properly.
try this

player:removeExperience(player:getExperience() - getExpForLevel(190), false)


-- edit
That math is wrong, sorry.

Code:
This is wrong.
1000 - 1200
player:removeExperience(getExpForLevel(190) - player:getExperience(), false)

This is wrong.
1200 - 1000
player:removeExperience(player:getExperience() - getExpForLevel(190), false)

This is right.
1200 - (1200 - 1000)
player:removeExperience(player:getExperience() - (player:getExperience() - getExpForLevel(190)), false)
 
Last edited by a moderator:
Back
Top