changos
Member
- Joined
- Feb 13, 2012
- Messages
- 75
- Solutions
- 5
- Reaction score
- 22
Hello otland community
i try to mix these both scripts but i get error i try several times/ways but i cant do it
i get those errors
[10/11/2018 23:16:23] [Error - LuaInterface::loadFile] data/spells/scripts/support/magic wall rune.lua:34: 'end' expected (to close 'function' at line 28) near 'countPos'
[10/11/2018 23:16:23] [Error - Event::checkScript] Cannot load script (data/spells/scripts/support/magic wall rune.lua)
[10/11/2018 23:16:23] data/spells/scripts/support/magic wall rune.lua:34: 'end' expected (to close 'function' at line 28) near 'countPos'
the first script is to prevent the mw on events and the second show the time remaining of the mw
and i try to modify the countdoown to appear in description of the mw with third script but i didnt succeed, i want the mw cannot be used in event zone, and it show the mw timer on desc, if not is in desc of mw then with antimated text its good for me, i hope u can helpme, Thanks n sorry for my bad english
OTX 2.44 SE based on tfs 0.4
i try to mix these both scripts but i get error i try several times/ways but i cant do it
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
function onCastSpell(cid, var)
if isInArea(getThingPosition(cid), fromPosition1, toPosition1) or isInArea(getThingPosition(cid), fromPosition2, toPosition2) then
return false, doPlayerSendCancel(cid, "You cannot use any runes in event zone.")
end
return doCombat(cid, combat, var)
end
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
function countPos(cid, pos, tempo)
if tempo > 0 and getTileItemById(pos, 1497) then
doSendAnimatedText(pos, tempo, TEXTCOLOR_YELLOW)
addEvent(countPos, 1000, cid, pos, tempo-1)
else
return doSendMagicEffect(pos, 2)
end
end
function onCastSpell(cid, var)
doCreatureSay(cid, 'WALL', TALKTYPE_ORANGE_1)
countPos(cid, var.pos, 20)
doCombat(cid, combat, var)
end
i get those errors
[10/11/2018 23:16:23] [Error - LuaInterface::loadFile] data/spells/scripts/support/magic wall rune.lua:34: 'end' expected (to close 'function' at line 28) near 'countPos'
[10/11/2018 23:16:23] [Error - Event::checkScript] Cannot load script (data/spells/scripts/support/magic wall rune.lua)
[10/11/2018 23:16:23] data/spells/scripts/support/magic wall rune.lua:34: 'end' expected (to close 'function' at line 28) near 'countPos'
the first script is to prevent the mw on events and the second show the time remaining of the mw
and i try to modify the countdoown to appear in description of the mw with third script but i didnt succeed, i want the mw cannot be used in event zone, and it show the mw timer on desc, if not is in desc of mw then with antimated text its good for me, i hope u can helpme, Thanks n sorry for my bad english
OTX 2.44 SE based on tfs 0.4