error:
global.lua:
droploot.lua:
[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