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

Problem with login chars

canaan

New Member
Joined
Sep 21, 2008
Messages
53
Reaction score
0
Look I have this problem every time a new player comes, I use Gessior Acc and the last version of TFS. It lags not only my server, but my whole computer

[05/05/2010 12:41:30] [Error - CreatureScript Interface]
[05/05/2010 12:41:30] data/creaturescripts/scripts/idle.lua nThink
[05/05/2010 12:41:30] Description:
[05/05/2010 12:41:30] data/creaturescripts/scripts/idle.lua:14: attempt to compare number with nil
[05/05/2010 12:41:30] stack traceback:
[05/05/2010 12:41:31] data/creaturescripts/scripts/idle.lua:14: in function


Anyone knows how to fix it? Thanks to everyone.
 
post you'r idle.lua script.

This is how mine looks.

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

Here is it, thanks.
 
take
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
 
@canaan, I had similar problem and I noticed that in config was an another registry.

Replace idle.lua

From
Code:
        idleWarning = getConfigValue('idleWarningTime'),
        idleKick = getConfigValue('idleKickTime')

To
Code:
        idleWarning = 14*6000,
        idleKick = 15*6000
 
Back
Top