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

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
978
Solutions
17
Reaction score
373
GitHub
olrios
Twitch
jamagowy
How to make it shorter?


PHP:
local config = {
	monster = {"Skeleton", "Demon skeleton"}
	pos1 = {x=100, y=100, z=7},
	pos2 = {x=103, y=100, z=7},
	pos3 = {x=105, y=99, z=7},
	pos4 = {x=106, y=102, z=7},
	pos5 = {x=107, y=100, z=7},
	pos6 = {x=114, y=103, z=7}
	}

if item.itemid == 103 and item.uid == 44000 then
	doSummonCreature(config.monster[1], config.pos1)
	doSummonCreature(config.monster[1], config.pos2)
	doSummonCreature(config.monster[2], config.pos3)
	doSummonCreature(config.monster[2], config.pos4)
	doSummonCreature(config.monster[2], config.pos5)
	doSummonCreature(config.monster[2], config.pos6)
	doSendMagicEffect(config.pos1, 34)
	doSendMagicEffect(config.pos2, 34)
	doSendMagicEffect(config.pos3, 34)
	doSendMagicEffect(config.pos4, 34)
	doSendMagicEffect(config.pos5, 34)
	doSendMagicEffect(config.pos6, 34)
end
 
Code:
local positions = {
	[1] = {x=100, y=100, z=7}},
	[2] = {x=103, y=100, z=7},
	[3] = {x=105, y=99, z=7},
	[4] = {x=106, y=102, z=7},
	[5] = {x=107, y=100, z=7},
	[6] = {x=114, y=103, z=7}
}

for n, pos in ipairs(positions) do
	duSummonCreature(n < 3 and 'Skeleton' or 'Demon Skeleton', pos)
	doSendMagicEffect(pos, 34)
end
 
Back
Top