• 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 Magic Wall!(Including Countdown) 95% Easy Configurtion!

Hello Everyone!

Ok what does this script do?
When you cast magic wall it will appear a countdown over the magic wall when the magic wall get removed!
Its 95% easy configurable, maybe bit messy but i did my best :(

How did you come up with this idea?
I saw on a few servers, their magic wall got timer over it, so i searched on otland and didnt find any posts :O
So i thougt hmm
... i going to make one for fun and train on scripting.

Please Feedback :(

This is my first script using config, i learned it by experimenting.

I love to make scripts easy to edit, so i made it more configurable and it took me time to come up with few ideas i added into the magic wall script :)

Enjoy!

First go to:
Data/Actions/actions.xml
Add this line:
Code:
<action itemid="2293" event="script" value="magicwall.lua" allowfaruse="1"/>

Now go into the scripts in the action folder:
Make a new lua and rename it "magicwall"

Open the lua and add paste this code:

Lua:
----------------------------------THIS CODE WAS SCRIPTED BY: OTSWE------------------------------------

local random_txt_onsay = true -- When casting a wall, should the player cast random catch phrases?

local otswe = {
	timer = 15, -- How long will the magic wall stay
	cooldown = 1, -- How long to cast another one
    words = {"I LOVE MAGIC WALL!","HAHA YOU CANT GET ME","BIATCH","BOOM"}, -- Here can you add or edit the catch phrases!
	txt = "END", -- Text when it removes
    color_on_timer = TEXTCOLOR_BLUE, -- Color on countdown
    empty_storage = 1000 -- Please set a unused storage
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerStorageValue(cid, otswe.empty_storage) > os.time()) then
		doPlayerSendCancel(cid, "You are exhausted.")
		return true
		end                  
	   if getTileInfo(getThingPos(cid)).protection then
              doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone.")
                 else	
		local function removemw()
			local magicwall = getTileItemById(toPosition, 1497).uid
			if(magicwall > 0) then
				doRemoveItem(magicwall)
				doSendAnimatedText(toPosition,otswe.txt, TEXTCOLOR_RED)
				doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT)
			end
			return true
		end 
		for mw = 1, otswe.timer do
		local o = otswe.timer - mw
			addEvent(doSendAnimatedText, mw * 1000, toPosition, o > 0 and tostring(o), otswe.color_on_timer)
		end 
		doCreateItem(1497, toPosition)
		setPlayerStorageValue(cid, otswe.storage, os.time() + otswe.cooldown)
		addEvent(removemw, otswe.timer * 1000)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA) 
	end
	if random_txt_onsay == true then
	doCreatureSay(cid, otswe.words[math.random(#otswe.words)], TALKTYPE_ORANGE_1)
	end
	return true
end

Enjoy!

Are you sure you just didn't watch a video of someone with elf-bot?
Or you actual saw it IG?
 
Good for a beginner, but please learn how to tab! ;)

I guess my script helped you then, huh? Glad to see someone around here learning something...
 
Thanks bro ^^ Still learning the tabb xD lazy todo it sometimes.
 
I know, but this isn't made for the newer versions :p
 
This should work, haven't tested it though..
Lua:
----------------------------------THIS CODE WAS SCRIPTED BY: OTSWE------------------------------------
 
local random_txt_onsay = true -- When casting a wall, should the player cast random catch phrases?
 
local otswe = {
	timer = 15, -- How long will the magic wall stay
	cooldown = 1, -- How long to cast another one
    words = {"I LOVE MAGIC WALL!","HAHA YOU CANT GET ME","BIATCH","BOOM"}, -- Here can you add or edit the catch phrases!
	txt = "END", -- Text when it removes
    color_on_timer = TEXTCOLOR_BLUE, -- Color on countdown
    empty_storage = 1000 -- Please set a unused storage
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerStorageValue(cid, otswe.empty_storage) > os.time()) then
		doPlayerSendCancel(cid, "You are exhausted.")
		return true
		end                  
	   if getTileInfo(getThingPos(cid)).protection then
              doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone.")
                 else	
		local function removemw()
			local magicwall = getTileItemById(toPosition, 1497).uid
			if(magicwall > 0) then
				doRemoveItem(magicwall)
				doCreatureSay(cid, otswe.txt, TALKTYPE_ORANGE_1, nil, nil, toPosition)
				doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT)
			end
			return true
		end 
		for mw = 1, otswe.timer do
		local o = otswe.timer - mw
			addEvent(doCreatureSay, mw * 1000, cid, o > 0 and tostring(o), TALKTYPE_ORANGE_1, nil, nil, toPosition)
		end 
		doCreateItem(1497, toPosition)
		setPlayerStorageValue(cid, otswe.storage, os.time() + otswe.cooldown)
		addEvent(removemw, otswe.timer * 1000)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA) 
	end
	if random_txt_onsay == true then
	doCreatureSay(cid, otswe.words[math.random(#otswe.words)], TALKTYPE_ORANGE_1)
	end
	return true
end

@offtopic
Why do you like putting your name everywhere in the script ?? That's just pathetic .. <_<
 
Last edited:
You forgot to change this part to :p

doSendAnimatedText(toPosition,otswe.txt, TEXTCOLOR_RED)
 
lol i can use like 5 magicwalls in same PLace It count like 40,4 ,32,43,56 ETC... PLease fix u can only use one after the first one removed.
 
Well, i have optimized the script, added blockwall, added it to check if that posistion you shoot on iswalkable and fixed protection zone check.

Enjoy! Remember i have not tested it yet, so hopefully someone can approve it works and you cant shoot on teleports and etc...
 
Well, i have optimized the script, added blockwall, added it to check if that posistion you shoot on iswalkable and fixed protection zone check.

Enjoy! Remember i have not tested it yet, so hopefully someone can approve it works and you cant shoot on teleports and etc...
Can't shoot on items like that,

63zvb8.png


&& console random error.
22klzk.png


PS: Can you change the timer to the new versions? [look at page 4 i think of this post, Joseph edited your older script , countdown was working with orange_talk~
THANKS !!

EDIT!! The Magic Wall never gets removed.
 
Last edited:
Well this script was created for not the latest versions, thats why you get that error.

But anyway i made it for both version 03 and 037.

Enjoy!

Lua:
----------------------------------THIS CODE WAS SCRIPTED BY: Cyko------------------------------------
 
local function isWalkable(pos, creature, proj, pz)-- by Nord
	if (getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0) then return false end
	if (getTopCreature(pos).uid > 0 and creature) then return false end
	if (getTileInfo(pos).protection and pz) then return false, true end
	local n = not proj and 3 or 2
	for i = 0, 255 do
		pos.stackpos = i
		local tile = getTileThingByPos(pos)
		if (tile.itemid ~= 0 and not isCreature(tile.uid)) then
			if (hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then
				return false
			end
		end
	end
	return true
end

local function doSendAnimatedText2(pos, value, color, player)
    if(not tonumber(value))then
        return error("arg #2 in doSendAnimatedText is not a number")
    end
    
    if(isPlayer(player))then
        doPlayerSendTextMessage(player, MESSAGE_EXPERIENCE, "", value, color, pos)
    else
        for _, v in ipairs(getSpectators(pos, 7, 5, true)) do
            if(isPlayer(v))then
                doPlayerSendTextMessage(v, MESSAGE_EXPERIENCE, "", value, color, pos)
            end
        end
    end
end

local version_check = 03 --if you use 0.3.7, then write 037! or if you use 0.3, write 03!
 
local random_txt_onsay = true -- When casting a wall, should the player cast random catch phrases?
 
local cyko = {
	timer = 15, -- How long will the magic wall stay
	cooldown = 1, -- How long to cast another one
    	words = {"I LOVE MAGIC WALL!","HAHA YOU CANT GET ME","BIATCH","BOOM"}, -- Here can you add or edit the catch phrases!
	txt = "END", -- Text when it removes
    	color_on_timer = TEXTCOLOR_BLUE, -- Color on countdown
    	empty_storage = 1000 -- Please set a unused storage
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    	if(getPlayerStorageValue(cid, cyko.empty_storage) > os.time()) then
		return (doPlayerSendCancel(cid, "You are exhausted."))
	end                  
	if (getTileInfo(getThingPos(cid)).protection or getTileInfo(toPosition).protection) then
		return (doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone."))
	end
	local function removemw()
		if(getTileItemById(toPosition, 1497).uid > 0) then
			if (version_check == 03) then
				return (doSendAnimatedText(toPosition,cyko.txt, TEXTCOLOR_RED) and doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) and doRemoveItem(getTileItemById(toPosition, 1497).uid))
			else
				return (doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) and doRemoveItem(getTileItemById(toPosition, 1497).uid))
			end
		end
	end 
	for mw = 1, cyko.timer do
		local o = cyko.timer - mw
		if (version_check == 03) then
			addEvent(doSendAnimatedText, mw * 1000, toPosition, o > 0 and tostring(o), cyko.color_on_timer)
		else
			addEvent(doSendAnimatedText2, mw * 1000, toPosition, o > 0 and tostring(o), cyko.color_on_timer)
		end
	end 
	if (isWalkable(toPosition, false, false, true, true, true)) then 
		doCreateItem(1497, toPosition)
		setPlayerStorageValue(cid, cyko.storage, os.time() + cyko.cooldown)
		addEvent(removemw, cyko.timer * 1000)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA) 
		if (random_txt_onsay == true) then
			doCreatureSay(cid, cyko.words[math.random(#cyko.words)], TALKTYPE_ORANGE_1)
		end
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
	end
	return true
end
 
Well this script was created for not the latest versions, thats why you get that error.

But anyway i made it for both version 03 and 037.

Enjoy!

Lua:
----------------------------------THIS CODE WAS SCRIPTED BY: Cyko------------------------------------
 
local function isWalkable(pos, creature, proj, pz)-- by Nord
	if (getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0) then return false end
	if (getTopCreature(pos).uid > 0 and creature) then return false end
	if (getTileInfo(pos).protection and pz) then return false, true end
	local n = not proj and 3 or 2
	for i = 0, 255 do
		pos.stackpos = i
		local tile = getTileThingByPos(pos)
		if (tile.itemid ~= 0 and not isCreature(tile.uid)) then
			if (hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then
				return false
			end
		end
	end
	return true
end

local function doSendAnimatedText2(pos, value, color, player)
    if(not tonumber(value))then
        return error("arg #2 in doSendAnimatedText is not a number")
    end
    
    if(isPlayer(player))then
        doPlayerSendTextMessage(player, MESSAGE_EXPERIENCE, "", value, color, pos)
    else
        for _, v in ipairs(getSpectators(pos, 7, 5, true)) do
            if(isPlayer(v))then
                doPlayerSendTextMessage(v, MESSAGE_EXPERIENCE, "", value, color, pos)
            end
        end
    end
end

local version_check = 03 --if you use 0.3.7, then write 037! or if you use 0.3, write 03!
 
local random_txt_onsay = true -- When casting a wall, should the player cast random catch phrases?
 
local cyko = {
	timer = 15, -- How long will the magic wall stay
	cooldown = 1, -- How long to cast another one
    	words = {"I LOVE MAGIC WALL!","HAHA YOU CANT GET ME","BIATCH","BOOM"}, -- Here can you add or edit the catch phrases!
	txt = "END", -- Text when it removes
    	color_on_timer = TEXTCOLOR_BLUE, -- Color on countdown
    	empty_storage = 1000 -- Please set a unused storage
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    	if(getPlayerStorageValue(cid, cyko.empty_storage) > os.time()) then
		return (doPlayerSendCancel(cid, "You are exhausted."))
	end                  
	if (getTileInfo(getThingPos(cid)).protection or getTileInfo(toPosition).protection) then
		return (doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone."))
	end
	local function removemw()
		if(getTileItemById(toPosition, 1497).uid > 0) then
			if (version_check == 03) then
				return (doSendAnimatedText(toPosition,cyko.txt, TEXTCOLOR_RED) and doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) and doRemoveItem(getTileItemById(toPosition, 1497).uid))
			else
				return (doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) and doRemoveItem(getTileItemById(toPosition, 1497).uid))
			end
		end
	end 
	for mw = 1, cyko.timer do
		local o = cyko.timer - mw
		if (version_check == 03) then
			addEvent(doSendAnimatedText, mw * 1000, toPosition, o > 0 and tostring(o), cyko.color_on_timer)
		else
			addEvent(doSendAnimatedText2, mw * 1000, toPosition, o > 0 and tostring(o), cyko.color_on_timer)
		end
	end 
	if (isWalkable(toPosition, false, false, true, true, true)) then 
		doCreateItem(1497, toPosition)
		setPlayerStorageValue(cid, cyko.storage, os.time() + cyko.cooldown)
		addEvent(removemw, cyko.timer * 1000)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA) 
		if (random_txt_onsay == true) then
			doCreatureSay(cid, cyko.words[math.random(#cyko.words)], TALKTYPE_ORANGE_1)
		end
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
	end
	return true
end
You can shoot on yourself and still doSendAnimatedTxt , you mind changing that line for doCreatureSay talktype_orange?
Just noticed that i can't use the rune on every ground, maybe you could add the countdown on the real mwall rune script? lol :[
 
so the problem that is you shoot from outside a pz zone to a pz zone is fixed?? that's my main problem :(
 
Ineed something like this but when i remove a wall with lever it need to countdown 120 until it will be back.
Can someone help me?
 
Back
Top