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

Action private spawner

UpInSmoke

Supreme Ruler
Joined
Nov 16, 2008
Messages
303
Reaction score
21
Made this for myself, thought others might benefit from it if there isn't already one out there
Lua:
local t = {
effect = CONST_ME_HITBYFIRE,
[65001] = {"snake", 20, 1*60, {x = 1153, y = 1449, z = 7}, {x = 1169, y = 1465, z = 7}, {x = 1161, y = 1457, z = 7}, 13455}, -- UniqueId of lever, monster, cooldown(minutes), count, top left pos, bottom right pos, middle pos, exhaust storage
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.uid]
	if getPlayerStorageValue(cid, v[7]) > os.time() then
		return doPlayerSendCancel(cid, 'You must wait '..getPlayerStorageValue(cid, v[7])-os.time()..' seconds to spawn more monsters.')
	end
		for i = 1, v[2] do
			local p = {x = math.random(v[4].x, v[5].x), y = math.random(v[4].y, v[5].y), z = math.random(v[4].z, v[5].z)}
			doCreateMonster(v[1], p)
		end
	doSendMagicEffect(getCreaturePosition(cid), t.effect)
	doPlayerSendTextMessage(cid, 21, "You have spawned "..v[2].." "..v[1].."s.")
	doTeleportThing(cid, v[6])
	setPlayerStorageValue(cid, v[7], os.time()+v[3])
return true
end

What it does:
Spawns x amount of x monster within a certian area all different spots (you specify the size in the config)
it teleports you to the middle of the spawn
it sets a cooldown on the lever being used (you can set to 0 if you dont want one)
enjoy :)
 
Last edited:
What does this actually do? Would be nice if you explained it better :p
 
I think it spawns x amount of monsters for x time in a room, it could be a nice donation item or even used for a quest.
 
[18/03/2014 20:08:01] [Error - Action Interface]
[18/03/2014 20:08:01] data/actions/scripts/privatespawnone/privatespawnonelever.lua:eek:nUse
[18/03/2014 20:08:01] Description:
[18/03/2014 20:08:01] ...ons/scripts/privatespawnone/privatespawnonelever.lua:7: attempt to index local 'v' (a nil value)
[18/03/2014 20:08:01] stack traceback:
[18/03/2014 20:08:01] ...ons/scripts/privatespawnone/privatespawnonelever.lua:7: in function <...ons/scripts/privatespawnone/privatespawnonelever.lua:5>
 
Back
Top