• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua quests

Hrsha

Member
Joined
May 30, 2010
Messages
450
Reaction score
21
Location
Egypt
hi otlanders

i wana make boss monster spawns after 6 hours from its death
and if it still alive it does not spawn other one

Code:
function onThink(interval)
 
local start = {x = 1033, y = 882, z = 5} -- the start of the area
local endd = {x = 1037, y = 886, z = 5} -- the end of the area
local monsterpos = {x = 1035, y = 884, z = 5} -- the monster spawn point
 
	for x = start.x, endd.x do
		for y = start.y, endd.y do
			if getTopCreature({x=x, y=y, z=start.z}).type == 2 then
				return true
			end
		end
	end	
 
	local m = math.random(1,3)
 
	if m == 1 then
		doSummonCreature("Frost Dragon", monsterpos) -- change to your bosses
	elseif m == 2 then
		doSummonCreature("Ghastly Dragon", monsterpos) -- change to your bosses
	elseif m == 3 then
		doSummonCreature("Dragon Lord", monsterpos) -- change to your bosses
	end
	return true
end
-- sizaro(at)otland.net

i have tried this script but it does not what i want it spawns automatic
and does not care about if monster still alive or not so its area full of that boss lol

2- also i wana make when that x boss in x area die creat magic force immediately
which will teleport u to x position and gonna disappear in 3 minutes

sorry for my bad english , gonna rep +
 
works but the magic force does not remove after x time

[15:21:55.906] [Error - CreatureScript Interface]
[15:21:55.906] In a timer event called from:
[15:21:55.906] data/creaturescripts/scripts/bossdeath.lua:onKill
[15:21:55.906] Description:
[15:21:55.906] (luaDoRemoveItem) Item not found

and i test it by summon the monster by myself i want it exist without i summon it
cuz if i added it on the map editor it will keep summon it
 
addEvent is fuck thing actually.

LUA:
function onKill(cid, target, lastHitKiller)
local k = t[getCreatureName(target):lower()]

local function deleteTeleport()
local getTeleport = getTileItemById(k.tpPos, 1387).uid
	if(getTeleport > 0) then
		doRemoveItem(getTeleport)
	end
end

	if isMonster(target) then
		if k then
			if isInRange(getCreaturePosition(target), k.fromPos, k.toPos) then
				doCreateTeleport(1387, k.tpToPos, k.tpPos)
				addEvent(deleteTeleport, ((k.teleportTime*1000)*60))
				addEvent(doCreateMonster, (((k.teleportTime*1000)*60)), getCreatureName(target), k.respPos)
			end
		end
	end
return true
end

this will works. dont delete your configs just replace function. Sorry if I am doing Bogart job and he dislike it
 
Last edited:
coooool i love u guys

as i said before how to make the morga exist from the beginning ?
cuz iam who summon it

but every thing works really fine thanks guys
 
coooool i love u guys

as i said before how to make the morga exist from the beginning ?
cuz iam who summon it

but every thing works really fine thanks guys

How do you want it to summon?

The script you posted on the first page seems to work fine. You just need to add a couple things, for the Morgaroth.
 
i want to summon it automatic like once only if i restarted the server
if it cant be no problem its fine i can summon it by myself once when i restart it xD
 
Test the one I sent to you via PM's. This will summon the Morg when you start up the server, and only then.

LUA:
function onStartup()
	doSummonCreature("Morgaroth", {x = 100, y = 100, z = 7}) -- position for the morgaroth
	return true
end
 
solved - thanks guys u are amazing

You must spread some Reputation . really sorry :S

gonna rep all of you

anybody know how to learn lua scripting ?
 
Back
Top