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

need some help, dunno how to manage this problem!

CheatsBCN

New Member
Joined
Mar 6, 2012
Messages
131
Reaction score
1
hi , after few hours trying to do the script, i advanced a lot, then i realised I couldnt do the script the way i wanted and the other way it should be done i didnt know how to do it. i have to make an event, i looked it up on the search function for a tutorial but cant find any1 like i want.

maybe u can help me with some help.

i have a room with a stone in the entrance, this room will have a "flamingo" that will give lot of exp. and i want this flamingo to be killed only once each 5 min. but i cant just do a flamingo respwn becouse im sure somedickhead high level will be standing on that position so flamingo doesnt rspwn. therefore i thought about a room with a rock in the entrance, each 5 min the rock will disappear till someone kill the flamingo, then all the ppl on the room will be teleported out of the room and the stone will apear again till the flamingo respwns (5 min)
 
You can clean the tile before spawning that flamingo including push creatures. If you can not do it then post your script and I will remake it.
 
Well, I tried myself on this problem, and come up with this script. I've tested it and it works perfectly.

Flamingo.lua (in Creaturescripts)
LUA:
local config = {
Timer = , 									-- Time in seconds to loot the monster, before player getting teleported out
StonePos = { x = , y = , z = , stackpos = }, 	-- Location of blocking stone
StoneID = 1304, 								-- Itemid of the stone
Outside = { x = , y = , z = },					-- Position, where you should be teleported out
top = { x = , y = , z = }, 						-- Top left corner of the cleaning room
down = { x = , y = , z = }, 					-- lowest right corner of the cleaing room
}

function onDeath(cid, corpse, lasthit, killer)
	addEvent(ClearRoom, 1000 * config.Timer, config.top, config.down, config.StonePos, config.StoneID, config.Outside)
    return TRUE
end

local function RemoveStone(pos)
	doRemoveItem(getThingfromPos(pos).uid, 1)
	return TRUE
end

function ClearRoom(Top, Down, StonePos, StoneID, Outside)
	for gx = Top.x, Down.x do
		for gy = Top.y, Down.y do
		local CheckTile = getThingfromPos({x = gx, y = gy, z = Top.z, stackpos = 255})
			if isPlayer(CheckTile.uid) == TRUE then
				doTeleportThing(CheckTile.uid, Outside)
			end
		end
	end
	doCreateItem(StoneID, 1, StonePos)
	addEvent(RemoveStone, 1000 * 60 * 5, StonePos)
	return TRUE
end

Add this somewhere in your "Flamingo".xml
Code:
  <script>
	<event name="Flamingo"/>
  </script>

and this in your creaturescripts.xml
Code:
<event type="death" name="Flamingo" script="Flamingo.lua"/>

I hope, I don't forgot something. If you have further questions, ask ;)
 
Back
Top