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

Lua Problems skullcheck.lua and idle.lua!

shurlie

just shurlie Xddd
Joined
Jun 20, 2008
Messages
194
Reaction score
1
Location
Sweden
Ive been getting these errors when I kill a monster, just added Svargrond arena to my map.. So my problem is that I can kill the first monster, but not the second one, not even attack it, or any other monster!

Im using:
OTX Server Version: 1.3.1 (Moon Princess Edition)
A server developed by Martyx, iMadison & Kazbin
Based Version on: The Forgotten Server Version: 0.3.6.1 (Crying Damson)

[Error - Creaturescript Interface]
data/creaturescripts/scripts/idle.lua: onThink
Description:
attempt to call a number value
stack traceback:

[Error - Creaturescript Interface]
data/creaturescripts/scripts/skullcheck.lua: onThink
Description:
attempt to call a number value
stack traceback:

HELP PLEASE!
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

Skullcheck.lua
LUA:
function onThink(cid, interval)
	if(not isCreature(cid)) then
		return
	end

	local skull, skullEnd = getCreatureSkull(cid), getPlayerSkullEnd(cid)
	if(skullEnd > 0 and skull > SKULL_WHITE and os.time() > skullEnd and not getCreatureCondition(cid, CONDITION_INFIGHT)) then
		doPlayerSetSkullEnd(cid, 0, skull)
	end
end
 
Last edited:
Back
Top