• 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 Script problem 0.3.6

GodSebbe

Banned User, reason: To Sexy
Joined
Apr 16, 2011
Messages
846
Reaction score
122
Location
Sweden
Delete Thread, problem solved.

Thank you for your support.
 
Last edited:
Hello. I tested Summs script. And it was a problem, Can't rly fix it.
I got: 0.3.6
8.54.

All the scripts: http://otland.net/f82/monster-arena-minigame-summ-153306/
The Code: [Action]
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1946 then
		return false
	end
 
	local p = {getThingFromPos(ma_config.fromPos[1]).uid, getThingFromPos(ma_config.fromPos[2]).uid}
	if not(isInArray(p, cid)) then
		return true
	end
 
	if not(p[1] > 0 and p[2] > 0) then
		return doPlayerSendCancel(cid, "You need an other player for this game.")
	end
 
	local monsters, players = areaCreatures(ma_config.area)
	if #players > 0 then
		return arraySendCancel(p, "The arena is currently in use.")
	elseif #monsters > 0 then
		for _, mid in pairs(monsters) do
			doRemoveThing(mid)
		end
	end
 
	doRemoveFieldsInArea(ma_config.area)
	for i = 1, 2 do
		doSendMagicEffect(getThingPos(p[i]), CONST_ME_POFF)
		doTeleportThing(p[i], ma_config.toPos[i])
		doSendMagicEffect(getThingPos(p[i]), CONST_ME_TELEPORT)
 
		local summon = doCreateMonster(ma_config.monsters[math.random(#ma_config.monsters)], getPositionByDirection(ma_config.toPos[i], ma_config.spawnDir[_], 1))
		doConvinceCreature(p[i], summon, true)
		registerCreatureEvent(summon, "MonsterArenaDeath")
	end
 
	return false
end

What happends:
[video]http://tinypic.com/player.php?v=30jnwow&s=5[/video]

Try changing:

Code:
local summon = doCreateMonster(ma_config.monsters[math.random(#ma_config.monsters)], getPositionByDirection(ma_config.toPos[i], ma_config.spawnDir[_], 1))
		doConvinceCreature(p[i], summon, true)

for:

Code:
doConvinceCreature(p[i], doCreateMonster(ma_config.monsters[math.random(#ma_config.monsters)], ma_config.toPos[i]))

if doesn't work, check if you created the new lib that the guy said on the script (Create a new lib file and add this (example: "libs/750-monsterArena.lua"):...)
 
Back
Top