• 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 arenakill.lua massive error

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
Error:
bug start when kill a one monster... and monster dont die...
Code:
[20:3:44.029] [Error - CreatureScript Interface]
[20:3:44.029] data/creaturescripts/scripts/arenakill.lua:onKill
[20:3:44.029] Description:
[20:3:44.029] data/creaturescripts/scripts/arenakill.lua:58: attempt to index global 'tasks' (a nil value)
[20:3:44.029] stack traceback:
[20:3:44.029]   data/creaturescripts/scripts/arenakill.lua:58: in function <data/creaturescripts/scripts/arenakill.lua:38>

file arenakills.lua
Lua:
function onKill(cid, target, damage, flags)
	if isPlayer(target) or not isInArray({1, 3}, flags) or getCreatureMaster(target) then
		return true
	end

	local name = getCreatureName(target):lower()
	if name == 'tirecz' then
		local players = getCreaturesInRange({x=33063, y=31035,z=3}, 10, 9, FALSE, TRUE)
		for i = 1, #players do
			doTeleportThing(players[i], t.newPos)
			doCreatureSay(players[i], t.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
		end
		return true
	end

	if spheres[name] then
		setGlobalStorageValue(spheres[name], -1)
		return true
	end

	local now = tasks[name]
	if (now) then
		if isInArray({-1, now.amount}, getPlayerStorageValue(cid, now.storage)) or (not isInArray({14003, 14004, 14005}, now.storage) and getPlayerStorageValue(cid, 14500) ~= now.storage) then
			return true
		end

		local newValue = getPlayerStorageValue(cid, now.storage) + 1
		setPlayerStorageValue(cid, now.storage, newValue)
	end

	local room = getArenaMonsterIdByName(getCreatureName(target))
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'You can enter next room!')
	end
	return true
end
 
Back
Top