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

error magic wall script

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
hiii, well like i said i have an error in the console, this is my script:

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

and i am getting this:

XML:
[05/08/2013 21:22:52] [Error - Action Interface] 
[05/08/2013 21:22:52] data/actions/scripts/magicwall.lua:onUse
[05/08/2013 21:22:52] Description: 
[05/08/2013 21:22:52] (luaDoCreateItem) Tile not found

plzz guys help me :(

- - - Updated - - -

i just saw that that happens when the throw magic wall into pz zone (yes, they can throw magic walls inside the temple or depot :()
 
He updated the script, but if you want the normal magic wall with countdown,

->http://otland.net/f81/magic-wall-including-countdown-95-easy-configurtion-161165/index4.html
you probably have the old script, he edited his first post, also check the last page you'll find another version,

&
im using this script ATM, it works fine
data/spells/scripts/support/magicwallrune.lua
Code:
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 combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, ITEM_MAGIC_WALL)
 
function onCastSpell(cid, var)
    local result = doCombat(cid, combat, var)
 
    if result then
        local pos = variantToPosition(var)
        for i = 0, 20 do
            addEvent(doSendAnimatedText2, i * 1000, pos, 20 - i, COLOR_RED)
        end
    end
 
    return result
end
 
no no, i want that script, because it has a dialog and a flame or something like that that appears with the magic wall, man i searched the update but i don't speak very well english and is hard for me to keep tracking the script, could you plz post the updated script here plz?? :(!!
 
ok then do this to your 95% mwall script

Change:
Code:
if getTileInfo(getThingPos(cid)).protection then
              doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone.")

TO:
Code:
if getTileInfo(getThingPos(cid)).protection or getTileInfo(toPosition).protection then
              doPlayerSendCancel(cid, "This action is not permitted in a protection zone.")

It will fix your PZ problem
 
Ok man thanks! i will test it right now

Sorry man is not working fine, now i'm having the same error but when they throw one upon one in the same tile :/ plzz help
 
Last edited:
Back
Top