• 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.X+ [Warning - ScriptingManager::loadScriptSystems] Can not load data/global.lua

anderkrox

New Member
Joined
May 14, 2020
Messages
21
Reaction score
1
error:
[Warning - ScriptingManager::loadScriptSystems] Can not load data/global.lua
> Loading lua libs

Lua Script Error: [Scripts Interface]
C:\Users\Anderson Sacani\Documents\Cerubra\Servidor\vcpkg\forgottenserver\data\scripts/lib\create_functions.lua
...kg\forgottenserver\data\scripts/lib\create_functions.lua:1: attempt to call global 'createFunctions' (a nil value)
stack traceback:
[C]: in function 'createFunctions'
...kg\forgottenserver\data\scripts/lib\create_functions.lua:1: in main chunk
create_functions.lua [error]
^

global.lua:
Lua:
function obtEstima(quem)
    local valorEstima = quem:getStorageValue(ESTIMA)
    if (valorEstima => 12000 and <= 20000) then
        return "Neutro" -- neutral
    elseif (valorEstima => 8000 and <= 11999) then
        return "Agressivo" -- aggressive
    elseif (valorEstima => 4000 and <= 7999) then
        return "Fraudulento" -- dishonest
    elseif (valorEstima => 1000 and <= 3999) then
        return "Malicioso" -- malicious
    elseif (valorEstima => 0 and <= 999) then
        return "Cruel" -- ruthless
    end
end

droploot.lua:
Lua:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local random = math.random(1, 100000)

    if obtEstima(player) == "Neutro" then
        -- Não dropa itens
    elseif obtEstima(player) == "Agressivo" then
        if random <= 10000 then -- 10%
            for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
                local item = player:getSlotItem(i)
                if item then
                    item:remove()
                end
            end
        end
    elseif obtEstima(player) == "Fraudulento" then
        if random <= 20000 then -- 20%
            for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
                local item = player:getSlotItem(i)
                if item then
                    item:remove()
                end
            end
        end
    elseif obtEstima(player) == "Malicioso" then
        if random <= 40000 then -- 40%
            for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
                local item = player:getSlotItem(i)
                if item then
                    item:remove()
                end
            end
        end
    elseif obtEstima(player) == "Cruel" then
        if random <= 80000 then -- 80%
            for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
                local item = player:getSlotItem(i)
                if item then
                    item:remove()
                end
            end
        end
    end
    return true
end
 
When I remove the funcion 'obtEstima(quem)' from global.lua, then start the server ...
Post automatically merged:

The problem is in '=> X and <= Y'

How to make it possible:
Lua:
reputation = {
    [Neutral] = {minStorage = 12000, maxStorage = 20000},
    [Aggressive] = {minStorage = 8000, maxStorage = 11999},
    [Dishonest] = {minStorage = 4000, maxStorage = 7999},
    [Malicious] = {minStorage = 1000, maxStorage = 3999},
    [Ruthless] = {minStorage = 0, maxStorage = 999},
}
?
 
Last edited:
Back
Top