• 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 removewall action

LUA:
local t = {
	walls = {{x = 100, y = 100, z = 7}, {x = 100, y = 100, z = 7}, {x = 100, y = 100, z = 7}},
	wall_id = 2134,
	monster = 'rat',
	wall_respawn_time = 5, --minutes
	room = {
		fromPos = {x = 100, y = 100, z = 7},
		toPos = {x = 100, y = 100, z = 7}
		}
	}
function onKill(cid, target, lastHit)
	if isMonster(target) then 
		if getCreatureName(target):lower() == t.monster then
			if isInRange(getCreaturePosition(target), t.room.fromPos, t.room.toPos) then
				for k = 1, #t.walls do
					if getTileItemById(t.walls[k], t.wall_id) then
						doRemoveItem(getTileItemById(t.walls[k], t.wall_id).uid)
						addEvent(doCreateItem, t.wall_respawn_time*60, 1, t.wall_id, t.walls[k]) 
					end
				end
			end
		end
	end
return TRUE
end

Thread moved to the requests board.
 
Last edited:
Thanks alot!! is this located in movements.xml? idk like:
PHP:
	<movevent type="RemoveItem" itemid="xxxx" event="script" value="remove_wall.lua"/>

and is for 3 walls? , (i know i can edit the number of walls but...) when the monster spawns again, whats up with the removed wall?
 
Edited the script, forgot about the wall getting back, and about the number of walls, it can be less or more :p
Also, it goes in creaturescripts (don't forget to add it to login.lua).
 
thanks a lot, it seems to be working but.. when i reloaded creaturescripts the server crashed and now when a player login the server crashs out, and in creaturescripts.xml like:
PHP:
	<event type="death" name="RemoveWall" event="script" value="remove_wall.lua"/>
? whats wrong? thnks alot anyway
 
Back
Top