• 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 Couple of errors from lms.lua and arenakill

ChickenRobot

New Member
Joined
Jul 22, 2013
Messages
25
Reaction score
0
If someone can help me out with this errors i will be very gratefully :)





lms.lua
Lua:
function loseOnLMSArena(cid)
    kickPlayerFromLMSArea(cid)
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doCreatureAddMana(cid, getCreatureMaxMana(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "BOOM! You are dead.")
    setPlayerStorageValue(cid, ZEAA_JOIN, 0)
    local players = getLMSEventPlayers()
    if(#players <= 1) then
        local winner = players[1]
        if(winner) then
            doPlayerAddItem(winner, 2160, 5, true)
	    doCreatureAddHealth(winner, getCreatureMaxHealth(winner))
	    doCreatureAddMana(winner, getCreatureMaxMana(winner))
            local item = doPlayerAddItem(winner, 7369, 1, true)
            doItemSetAttribute(item, "description", getPlayerName(winner) .. " was the winner of Last Man Standing Event.")
	    setPlayerStorageValue(winner, ZEA_JOIN, 0)
            doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won Last Man Standing Event.")
            doBroadcastMessage("After " .. os.time() - getPlayerLMSEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Last Man Standing Event in game versus " ..  getLMSEventPlayersLimit() - #getLMSEventPlayers() .. " players!")
            kickPlayerFromLMSArea(winner)
        else
            doBroadcastMessage("Last Man Standing Event finished! No one win?!?!?! WTF!")
        end
        doSetStorage(ZEA_STATUS, 0)
        doSetStorage(ZEA_PLAYERS_NUMBER, ZEA_DEFAULT_NUMBER_OF_PLAYERS)
        doSetStorage(ZEA_LMS_TO_SPAWN, 0)
        doSetStorage(ZEA_LMS_SPAWNED, 0)
        local width = (math.max(ZEA_spawnFromPosition.x, ZEA_spawnToPosition.x) - math.min(ZEA_spawnFromPosition.x, ZEA_spawnToPosition.x)) / 2 + 1
        local height = (math.max(ZEA_spawnFromPosition.y, ZEA_spawnToPosition.y) - math.min(ZEA_spawnFromPosition.y, ZEA_spawnToPosition.y)) / 2 + 1
        local centerPos = {x=math.min(ZEA_spawnFromPosition.x, ZEA_spawnToPosition.x)+width,y=math.min(ZEA_spawnFromPosition.y, ZEA_spawnToPosition.y)+height,z=ZEA_spawnFromPosition.z}
        for z = math.min(ZEA_spawnFromPosition.z, ZEA_spawnToPosition.z), math.max(ZEA_spawnFromPosition.z, ZEA_spawnToPosition.z) do
            centerPos.z = z
        end
    end
end
 
function onStatsChange(target, cid, changetype, combat, value)
    if isPlayer(target) and getPlayerStorageValue(target, ZEA_JOIN) == 1 then if(getStorage(ZEA_STATUS) == 1) then return false end end
    corpse_ids = {
        [0] = 3065, -- female
        [1] = 3058 -- male
}
    if((isInRange(getThingPosition(target), ZEA_spawnFromPosition, ZEA_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then 
        lose = addEvent(loseOnLMSArena, 1, target)
        corpse = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(target))
        doCreateItem(2016, 2, getThingPos(target))
        doItemSetAttribute(corpse, "description", "You recognize "..getCreatureName(target)..". He was killed by "..(isMonster(target) and "a "..string.lower(getCreatureName(cid)) or isCreature(cid) and getCreatureName(cid) or "a field item")..". In [LMS-Event]") 
        return false
    end
    return true
end
 
function onTarget(cid, target)
	if isPlayer(target) and getPlayerStorageValue(target, ZEA_JOIN) == 1 then
	if(getStorage(ZEA_STATUS) == 1) then
		doPlayerSendCancel(cid, "Wait until the Last Man Standing Event Starts.")
		return false
		end
	end
	return true
end
 
function onThink(cid)
	local summons = getCreatureSummons(cid)
	if isCreature(summons[1]) and getPlayerStorageValue(cid, ZEA_JOIN) == 1 then
		doRemoveCreature(summons[1])
	return true
end
end
 
function onLogin(cid)
       if getPlayerStorageValue(cid, ZEA_JOIN) == 1 then
       	  setPlayerStorageValue(cid, ZEA_JOIN, 0)
     end
     return true
end

64 Line
Lua:
if isCreature(summons[1]) and getPlayerStorageValue(cid, ZEA_JOIN) == 1 then

arenakill.lua
Lua:
local t = {
	newPos = {x=33064, y=31026, z=7},
	msg = "You have won! As new champion take the ancient armor as reward before you leave.",
	area = {
		fromX = 33067, toX = 33083,
		fromY = 31030, toY = 31049,
		z = 3
	}
}
local a = {
	newPos = {x=32940, y=31460, z=1},
	msg = "You have won! As new champion take the boss Marziel as reward before you leave.",
	area = {
		fromX = 32936, toX = 32944,
		fromY = 31456, toY = 31464,
		z = 2
	}
}
local spheres = {
	['energy overlord'] = 8568,
	['fire overlord'] = 8569,
	['ice overlord'] = 8570,
	['earth overlord'] = 8578
}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
				table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if(creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
              if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
	return creaturesList
end

local time = 1 
local timer = 60 -- 60 = 1min
local pos = {x=33098, y=31978, z=11}

local function Eliminar()
local piedra2 = {x = 33098, y = 31978, z = 11, stackpos = 1}
local piedrapos = getThingfromPos(piedra2)
	doRemoveItem(piedrapos.uid, 1)
end

local re = function(re)
	doCreateItem(18459, 1, pos)
end

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=33074, y=31039,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 isPlayer(target) or not isInArray({1, 3}, flags) or getCreatureMaster(target) then
		return true
	end

	local name = getCreatureName(target):lower()
	if name == 'vampire bride' and (getPlayerStorageValue(cid, 15300) == 58) and (getPlayerStorageValue(cid, 17300) == 2) then
		if (getPlayerStorageValue(cid, 15300) == 58) and (getPlayerStorageValue(cid, 17300) == 2) then
		local players = getCreaturesInRange({x=32940, y=31460,z=2}, 10, 9, FALSE, TRUE)
		for i = 1, #players do
			doTeleportThing(players[i], a.newPos)
			doCreatureSay(players[i], a.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
		end
	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

Line 104
Lua:
local newValue = getPlayerStorageValue(cid, now.storage) + 1


Kind Regards,
ChickenRobot
 
Last edited:
Back
Top