• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

RevScripts Server wont load lua scripts with revscript spell (Nekiro's TFS 1.5 7.72 downgrade)

jakub742

Member
Joined
May 1, 2010
Messages
110
Solutions
2
Reaction score
8
Location
Slovakia
Hi im trying to use LUA to make spells and monsters instead of XML. Monsters are working fine but i cant figure out how to run the spell.

So i tried the default example from repo in data/scripts/spells/example.lua But server wont start it just get stuck for few seconds on
Loading lua scripts ... and then just restarts without any Error.

So im having trouble figuring out the reason.
Also checked the lua file syntax with "luajit -bl". It was ok.

I also tried @Xikini code from tfs-1-3-how-to-create-an-instant-spell-in-spell-folder-revscripts, also my own script that i tried:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
combat:setArea(createCombatArea(AREA_SQUAREWAVE6))
function onGetFormulaValues(player, level, magicLevel)
    local min = 520 
    local max = 680 
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local spell = Spell("instant")
spell:name("frost poison wave")
-- spell:words("####0001")
-- spell:id(101)
-- spell:direction(1)
function spell.onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
spell:register()

Server just wont load with any .lua script in data/scripts/spells/ unless its commented#. Thanks for the help.
Post automatically merged:

EDIT: in my code there should be
Spell(SPELL_INSTANT) instead of Spell("instant") (I was just trying a lot of examples and changes and forgot to change back)
 
Top