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

Lua CreatureScript Log In Error-GetRewardList

sebas908

New Member
Joined
Aug 19, 2008
Messages
6
Reaction score
1
Hi,

Im pretty new to this but recently got my hands on a server i wish to use as a base to start hosting. I have ran into some issues but this by far i havent been able to fix and its really annoying as its preventing my character from loging on. Would appreciate any help.

Untitled.png


If the entire login.lua is required please let me know and ill put it up. Thanks
 
Hi,

Im pretty new to this but recently got my hands on a server i wish to use as a base to start hosting. I have ran into some issues but this by far i havent been able to fix and its really annoying as its preventing my character from loging on. Would appreciate any help.

Untitled.png


If the entire login.lua is required please let me know and ill put it up. Thanks
would be nice to post the script so people can get an understand of what's happening
the actual error is because getRewardList isn't a method to whatever the userdata is
 
would be nice to post the script so people can get an understand of what's happening
the actual error is because getRewardList isn't a method to whatever the userdata is
Sure, here it is, thanks for the reply.

local events = {
'ElementalSpheresOverlords',
'BigfootBurdenVersperoth',
'Razzagorn',
'Shatterer',
'Zamulosh',
'The Hunger',
'The Rage',
'Eradicator',
'Eradicator1',
'Rupture',
'World Devourer',
'Tarbaz',
'Shulgrax',
'Ragiaz',
'Plagirath',
'Mazoran',
'Destabilized',
'BigfootBurdenWiggler',
'SvargrondArenaKill',
'NewFrontierShardOfCorruption',
'NewFrontierTirecz',
'ServiceOfYalaharDiseasedTrio',
'ServiceOfYalaharAzerus',
'ServiceOfYalaharQuaraLeaders',
'InquisitionBosses',
'InquisitionUngreez',
'KillingInTheNameOfKills',
'KillingInTheNameOfKillss',
'KillingInTheNameOfKillsss',
'MastersVoiceServants',
'SecretServiceBlackKnight',
'ThievesGuildNomad',
'WotELizardMagistratus',
'WotELizardNoble',
'WotEKeeper',
'WotEBosses',
'WotEZalamon',
'WarzoneThree',
'PlayerDeath',
'AdvanceSave',
'bossesWarzone',
'AdvanceRookgaard',
'PythiusTheRotten',
'DropLoot',
'Yielothax',
'BossParticipation',
'Energized Raging Mage',
'Raging Mage',
'modalMD1',
'VibrantEgg',
'DeathCounter',
'KillCounter',
'bless1',
'lowerRoshamuul'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
local player = Player(cid)
if not player then
return true
end

local playerPosition = player:getPosition()
if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
player:setStorageValue(Storage.combatProtectionStorage, 0)
return true
end

addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendOutfitWindow()
player:sendTutorial(1)
else
if loginStr ~= "" then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
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)

local playerId = player:getId()

-- Stamina
nextUseStaminaTime[playerId] = 1

-- STAMINA DEVIDO A QUEDAS START

--local stamina_full = 42 * 60 -- config. 42 = horas
-- if player:getStamina() >= stamina_full then
-- player:sendCancelMessage("Your stamina is already full.")
-- elseif player:getPremiumDays() < 1 then
-- player:sendCancelMessage("You must have a premium account.")
-- else
-- player:setStamina(stamina_full)
-- player:sendTextMessage(MESSAGE_INFO_DESCR, "Your stamina has been refilled.")
-- end

-- STAMINA DEVIDO A QUEDAS END

-- Promotion
--[[ local vocation = player:getVocation()
local promotion = vocation:getPromotion()
if player:isPremium() then
local value = player:getStorageValue(Storage.Promotion)
if not promotion and value ~= 1 then
player:setStorageValue(Storage.Promotion, 1)
elseif value == 1 then
player:setVocation(promotion)
end
elseif not promotion then
player:setVocation(vocation:getDemotion())
end--]]

-- ABRIR CHANNELS
if(not isInArray({1,2,3,5,6,7,8}, player:getVocation():getId()) or player:getLevel() < 6) then
-- player:eek:penChannel(7) -- help channel
player:eek:penChannel(3) -- world chat
player:eek:penChannel(6) -- advertsing rook main
else
-- player:eek:penChannel(7) -- help channel
player:eek:penChannel(3) -- world chat
player:eek:penChannel(5) -- advertsing main
end

--
-- Rewards
local rewards = #player:getRewardList()
if(rewards > 0) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
end

-- Update player id
local stats = player:inBossFight()
if stats then
stats.playerId = player:getId()
end

-- fury gates

if Game.getStorageValue(GlobalStorage.FuryGates, (9710)) == 1 then -- for venore
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9711)) == 2 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9712)) == 3 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9713)) == 4 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9714)) == 5 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9716)) == 6 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
end


player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs on our Forum and get tibia coins for important reports!')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Bugs Fixed] !')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BONUS EXP] Command for check !exp.')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[GUILD LEADER COMMAND] Will change all outfits from members !outfit.')

-- Events
for i = 1, #events do
player:registerEvent(events)
end

if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
onMovementRemoveProtection(playerId, player:getPosition(), 10)
end
return true
end
 
Last edited:
Sure, here it is, thanks for the reply.

local events = {
'ElementalSpheresOverlords',
'BigfootBurdenVersperoth',
'Razzagorn',
'Shatterer',
'Zamulosh',
'The Hunger',
'The Rage',
'Eradicator',
'Eradicator1',
'Rupture',
'World Devourer',
'Tarbaz',
'Shulgrax',
'Ragiaz',
'Plagirath',
'Mazoran',
'Destabilized',
'BigfootBurdenWiggler',
'SvargrondArenaKill',
'NewFrontierShardOfCorruption',
'NewFrontierTirecz',
'ServiceOfYalaharDiseasedTrio',
'ServiceOfYalaharAzerus',
'ServiceOfYalaharQuaraLeaders',
'InquisitionBosses',
'InquisitionUngreez',
'KillingInTheNameOfKills',
'KillingInTheNameOfKillss',
'KillingInTheNameOfKillsss',
'MastersVoiceServants',
'SecretServiceBlackKnight',
'ThievesGuildNomad',
'WotELizardMagistratus',
'WotELizardNoble',
'WotEKeeper',
'WotEBosses',
'WotEZalamon',
'WarzoneThree',
'PlayerDeath',
'AdvanceSave',
'bossesWarzone',
'AdvanceRookgaard',
'PythiusTheRotten',
'DropLoot',
'Yielothax',
'BossParticipation',
'Energized Raging Mage',
'Raging Mage',
'modalMD1',
'VibrantEgg',
'DeathCounter',
'KillCounter',
'bless1',
'lowerRoshamuul'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
local player = Player(cid)
if not player then
return true
end

local playerPosition = player:getPosition()
if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
player:setStorageValue(Storage.combatProtectionStorage, 0)
return true
end

addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendOutfitWindow()
player:sendTutorial(1)
else
if loginStr ~= "" then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
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)

local playerId = player:getId()

-- Stamina
nextUseStaminaTime[playerId] = 1

-- STAMINA DEVIDO A QUEDAS START

--local stamina_full = 42 * 60 -- config. 42 = horas
-- if player:getStamina() >= stamina_full then
-- player:sendCancelMessage("Your stamina is already full.")
-- elseif player:getPremiumDays() < 1 then
-- player:sendCancelMessage("You must have a premium account.")
-- else
-- player:setStamina(stamina_full)
-- player:sendTextMessage(MESSAGE_INFO_DESCR, "Your stamina has been refilled.")
-- end

-- STAMINA DEVIDO A QUEDAS END

-- Promotion
--[[ local vocation = player:getVocation()
local promotion = vocation:getPromotion()
if player:isPremium() then
local value = player:getStorageValue(Storage.Promotion)
if not promotion and value ~= 1 then
player:setStorageValue(Storage.Promotion, 1)
elseif value == 1 then
player:setVocation(promotion)
end
elseif not promotion then
player:setVocation(vocation:getDemotion())
end--]]

-- ABRIR CHANNELS
if(not isInArray({1,2,3,5,6,7,8}, player:getVocation():getId()) or player:getLevel() < 6) then
-- player:eek:penChannel(7) -- help channel
player:eek:penChannel(3) -- world chat
player:eek:penChannel(6) -- advertsing rook main
else
-- player:eek:penChannel(7) -- help channel
player:eek:penChannel(3) -- world chat
player:eek:penChannel(5) -- advertsing main
end

--
-- Rewards
local rewards = #player:getRewardList()
if(rewards > 0) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
end

-- Update player id
local stats = player:inBossFight()
if stats then
stats.playerId = player:getId()
end

-- fury gates

if Game.getStorageValue(GlobalStorage.FuryGates, (9710)) == 1 then -- for venore
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9711)) == 2 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9712)) == 3 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9713)) == 4 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9714)) == 5 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9716)) == 6 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
end


player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs on our Forum and get tibia coins for important reports!')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Bugs Fixed] !')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BONUS EXP] Command for check !exp.')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[GUILD LEADER COMMAND] Will change all outfits from members !outfit.')

-- Events
for i = 1, #events do
player:registerEvent(events)
end

if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
onMovementRemoveProtection(playerId, player:getPosition(), 10)
end
return true
end
use [.code] codehere [./code] tags without the . next time
Code:
 codehere
anyways where did you download your server from?
the method is for loot reward chest, there should be a method for Player:getRewardList() in lib\core\player.lua
if you don't care for reward chest, you can just remove
Code:
    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end
 
use [.code] codehere [./code] tags without the . next time
Code:
 codehere
anyways where did you download your server from?
the method is for loot reward chest, there should be a method for Player:getRewardList() in lib\core\player.lua
if you don't care for reward chest, you can just remove
Code:
    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end
Great thanks. I got it from tibiaking, like I mentioned its just a base, got a lot of work ahead of it and i appreciate your help. So you said I can remove it but the thing is when i shoot up the server it keeps giving me
the same error dont know why if the lines were deleted.
 
Great thanks. I got it from tibiaking, like I mentioned its just a base, got a lot of work ahead of it and i appreciate your help. So you said I can remove it but the thing is when i shoot up the server it keeps giving me
the same error dont know why if the lines were deleted.
there should be absolutely no reason it would give the same error if you removed the lines and saved the file
there was only one occurrence of that method so if it was deleted there would be no error
 
there should be absolutely no reason it would give the same error if you removed the lines and saved the file
there was only one occurrence of that method so if it was deleted there would be no error
Thats my bad you are very right , greatly appreciate your help man it was bugging me since yesterday guess i probably didnt save it all the times i tried getting rid of it.
 
Back
Top