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

Idle problem

Aardappel

Learning LUA
Joined
Dec 24, 2007
Messages
145
Reaction score
0
Hi guys,

Every time when i loggin on my server my console will; spawn this error:
Code:
[02/06/2010 17:28:48] [Error - CreatureScript Interface] 
[02/06/2010 17:28:48] data/creaturescripts/scripts/idle.lua:onThink
[02/06/2010 17:28:48] Description: 
[02/06/2010 17:28:48] data/creaturescripts/scripts/idle.lua:14: attempt to compare number with nil
[02/06/2010 17:28:48] stack traceback:
[02/06/2010 17:28:48] 	data/creaturescripts/scripts/idle.lua:14: in function <data/creaturescripts/scripts/idle.lua:6>
 
creaturescripts.xml
Code:
	<event type="think" name="Idle" event="script" value="idle.lua"/>

idle.lua
Lua:
local config = {
	idleWarning = getConfigValue('idleWarningTime'),
	idleKick = getConfigValue('idleKickTime')
}

function onThink(cid, interval)
	if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or
		getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then
		return true
	end

	local idleTime = getPlayerIdleTime(cid) + interval
	doPlayerSetIdleTime(cid, idleTime)
	if(config.idleKick > 0 and idleTime > config.idleKick) then
		doRemoveCreature(cid)
	elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
		local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
		if(config.idleKick > 0) then
			message = message .. ", you will be disconnected in "
			local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
			if(diff > 1) then
				message = message .. diff .. " minutes"
			else
				message = message .. "one minute"
			end

			message = message .. " if you are still idle"
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
	end

	return true
end
 
Hi guys,

Every time when i loggin on my server my console will; spawn this error:
Code:
[02/06/2010 17:28:48] [Error - CreatureScript Interface] 
[02/06/2010 17:28:48] data/creaturescripts/scripts/idle.lua:onThink
[02/06/2010 17:28:48] Description: 
[02/06/2010 17:28:48] data/creaturescripts/scripts/idle.lua:14: attempt to compare number with nil
[02/06/2010 17:28:48] stack traceback:
[02/06/2010 17:28:48] 	data/creaturescripts/scripts/idle.lua:14: in function <data/creaturescripts/scripts/idle.lua:6>

I have the same problem, hope someone can come up with a fix, have been looking but no clue what causes this...
 
Back
Top