• 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.lua and preparedeath.lua error need help fast!

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
when i added my forever aol with rs/bs protect so you die you dont lose any items...
But when i updated to donation trunk this script faild and a script helpt med updating preparedeath but i get this error in idle.lua and it couse lag just before when the player logges in.
scripts:
preparedeath
Code:
function onPrepareDeath(cid, deathList)
	if isPlayer(cid) then
		if getPlayerSlotItem(cid, 2).itemid == 115 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
			doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
			doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
			doRemoveConditions(cid, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
			doPlayerPopupFYI(cid, "You are dead.")
			doRemoveCreature(cid)
			return false
		end
	end
	return true
end

idle error:
Code:
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
error in consol:
Code:
[10/12/2009 12:00:20] [Error - CreatureScript Interface] 
[10/12/2009 12:00:20] data/creaturescripts/scripts/idle.lua:onThink
[10/12/2009 12:00:20] Description: 
[10/12/2009 12:00:20] data/creaturescripts/scripts/idle.lua:7: attempt to index a boolean value
[10/12/2009 12:00:20] stack traceback:
[10/12/2009 12:00:21] 	data/creaturescripts/scripts/idle.lua:7: in function <data/creaturescripts/scripts/idle.lua:6>
 
Back
Top