nefinoo
Carnage.flv
Code:
Lua Script Error: [Scripts Interface]
C:\Users\Nefi\OneDrive\Escritorio\forgottenserver-master\data\scripts\CUSTOMS NEFI\MonstersPoints.lua:callback
...rver-master\data\scripts\CUSTOMS NEFI\MonstersPoints.lua:16: attempt to compare number with nil
stack traceback:
...rver-master\data\scripts\CUSTOMS NEFI\MonstersPoints.lua:16: in function <...rver-master\data\scripts\CUSTOMS NEFI\MonstersPoints.lua:3>
Lua:
local CusMons = CreatureEvent("CusMons")
function CusMons.onKill(player, target)
local config = { -- Use missionStorage to link the monsters to each mission. It is set up this way so multiple missions can have the same monsters.
[1] = {name = "Rat", amount = 1, missionStorage = 43000},
[2] = {name = "Cave Rat", amount = 2, missionStorage = 43000},
[3] = {name = "Troll", amount = 3, missionStorage = 43000}
}
if target:isPlayer() or target:getMaster() then
return true
end
for i = 1, #config do
if target:getName() == config[i].name then
if storage >= 0 and storage < maximo then
player:setStorageValue(config[i].missionStorage, player:getStorageValue(config[i].missionStorage) + config[i].amount)
elseif storage == maximo then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Your monsters points are full, waste on the !store.")
end
end
end
return true
end
CusMons:register()