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 !.
follow my login.lua:
Support has logged in.
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.luanLogin
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