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

[Request] Checking script

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
I need a action scripts that checks if there is any monseters at a special area, and if it isn't existing any monsters, it will summon some monsters if the lever is used.

I am using The Forgotten Server v0.2 (Mystic Spirit)

if it is possible can you please make one script like that? and if it isn't possible..... then, can it be possible to make a similar?

It would be "cool" to have a script like that :p
and thanx for your answear.

Edit:
I think you don't need to do the summon part, just the checking part of this script, but it would help me a bit if you could do the summon part too :p

Code:
if item.uid == 30014 then
if item.itemid == 1946 then
 --- if checking == 0/True then (or something like that)
1pos = {x=1457, y=655, z=10}
2pos = {x=1461, y=654, z=10}
3pos = {x=1453, y=653, z=10}
4pos = {x=1464, y=651, z=10}
5pos = {x=1467, y=652, z=10}
6pos = {x=1455, y=650, z=10}

doSummonCreature("Ice Witch", 1pos)
doSummonCreature("Ice Golem", 2pos)
doSummonCreature("Ice Golem", 3pos)
doSummonCreature("Ice Witch", 4pos)
doSummonCreature("Frost Dragon", 5pos)
doSummonCreature("Frost Dragon", 6pos)
end
end
Well something like that
 
Last edited:
i see an error already, change

Code:
if item.uid == 30014 then
if item.itemid == 1946 then
 --- if checking == 0/True then (or something like that)
1pos = {x=1457, y=655, z=10}
2pos = {x=1461, y=654, z=10}
3pos = {x=1453, y=653, z=10}
4pos = {x=1464, y=651, z=10}
5pos = {x=1467, y=652, z=10}
6pos = {x=1455, y=650, z=10}

doSummonCreature("Ice Witch", 1pos)
doSummonCreature("Ice Golem", 2pos)
doSummonCreature("Ice Golem", 3pos)
doSummonCreature("Ice Witch", 4pos)
doSummonCreature("Frost Dragon", 5pos)
doSummonCreature("Frost Dragon", 6pos)
end
end

to

Code:
if item.itemid == 1945 and item.uid == 30014 then
 --- if checking == 0/True then (or something like that)
1pos = {x=1457, y=655, z=10}
2pos = {x=1461, y=654, z=10}
3pos = {x=1453, y=653, z=10}
4pos = {x=1464, y=651, z=10}
5pos = {x=1467, y=652, z=10}
6pos = {x=1455, y=650, z=10}

doSummonCreature("Ice Witch", 1pos)
doSummonCreature("Ice Golem", 2pos)
doSummonCreature("Ice Golem", 3pos)
doSummonCreature("Ice Witch", 4pos)
doSummonCreature("Frost Dragon", 5pos)
doSummonCreature("Frost Dragon", 6pos)
end
end
 
@ BigB, from looking at the script, obviously it wouldnt work... its just an example of what he wants.

@tosse12, look at the advanced anni scripts in the actions section, they use a system to check and see if there are monsters/players there. then they summon.
 
@ACrippledBadger, i know it wouldn't work, i was just showing him something that he already did wrong, so he can use the knowledge we give him to learn to make his own scripts instead of relying on other people...
 
you mean that I need to copy this one, right?
Code:
function cleanArea()
	local checking= {x = starting.x, y = starting.y, z = starting.z, stackpos = 253}
	local monster = {}
	while(checking.y <= ending.y) do
		local creature = getTopCreature(checking)
		if(isCreature(creature) == TRUE) then
			if(isPlayer(creature) == TRUE) then
				return false
			else
				table.insert(monster, creature)
			end
		end
		if(checking.x == ending.x) then
			checking.x = starting.x
			checking.y = checking.y + 1
		end
		checking.x = checking.x + 1
	end
	for i, c in ipairs(monster) do 
		doRemoveCreature(c)
	end	
	return true
end

But I need to change things in this one.... but what do I need to change/remove/add ?

shall it look something like this?
Code:
local starting= {x = 516, y = 150, z = 12}
local ending= {x = 556, y = 178, z = 12}

function cleanArea()
	local checking= {x = starting.x, y = starting.y, z = starting.z, stackpos = 253}
	local monster = {}
	while(checking.y <= ending.y) do
		local creature = getTopCreature(checking)
		if(isCreature(creature) == TRUE) then
				return false
			else
				table.insert(monster, creature)
			end
		end
		if(checking.x == ending.x) then
			checking.x = starting.x
			checking.y = checking.y + 1
		end
		checking.x = checking.x + 1
	end
	for i, c in ipairs(monster) do 
	end	
	return true
end

and how do I do to add this togther with my "script" that I have on the top of this thread?
 
the part you just posted is just to keep the area clean, checking for items and such i think, and to make itso that when a monster dies, its not there till it decays, and it will make the spawn area neater looking.
 
Dam-.-'' well how do I do so it checks the area if it is clean from monsters, and then summons my monsters, and if it isn't clean then it won't summon the monsters if I pull the lever? I am getting a bit confused xD
 
Code:
local starting= {x = 516, y = 150, z = 12}
local ending= {x = 556, y = 178, z = 12}

function cleanArea()
	local checking= {x = starting.x, y = starting.y, z = starting.z, stackpos = 253}
	local monster = {}
	while(checking.y <= ending.y) do
		local creature = getTopCreature(checking)
		if(isCreature(creature) == TRUE) then
				return false
			else
				table.insert(monster, creature)
			end
		end
		if(checking.x == ending.x) then
			checking.x = starting.x
			checking.y = checking.y + 1
		end
		checking.x = checking.x + 1
	end
	for i, c in ipairs(monster) do 
	end	
	return true
end

that is a code, just to clean an area, in which you want the monsters summoned, if you want monsters to be summoned there try adding

Code:
local mPos = {x = 0000, y = 0000, z = 0000}
doSummonCreature"Demon",mPos)

just gonna give you that, so you can learn some :)
 
Back
Top Bottom