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

Help with Error in Dodge and Critical System tfs 1.3

Felipe Crl

New Member
Joined
May 21, 2020
Messages
5
Reaction score
0
Hello guys, I came here to ask for your help. i am a very layman in open tibia and i am learning now! I was wondering if you could help me with the following mistake !.

Support has logged in.

Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.lua:eek:nLogin
data/creaturescripts/scripts/login.lua:33: attempt to call method 'getDodgeLevel' (a nil value)
stack traceback:
[C]: in function 'getDodgeLevel'
data/creaturescripts/scripts/login.lua:33: in function <data/creaturescripts/scripts/login.lua:1>
Support has logged out.

follow my login.lua:

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()
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)

-- Stamina
nextUseStaminaTime[player.uid] = 0

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

-- Dodge/Critical System
if player:getDodgeLevel() == -1 then
player:setDodgeLevel(0)
end
if player:getCriticalLevel() == -1 then
player:setCriticalLevel(0)
end

-- Events
player:registerEvent("PlayerDeath")
player:registerEvent("DropLoot")
player:registerEvent("DodgeMana")
player:registerEvent("DodgeCritical")

return true
end
 

Kooda

Member
Joined
May 7, 2021
Messages
20
Solutions
4
Reaction score
14
There is no
Lua:
getDodgeLevel
function on your server, did you install the system before using those lines?
 
Top