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

Help with Action Script TFS 1.2

lazarus321

Member
Joined
May 8, 2017
Messages
222
Reaction score
23
Hi all,

I have one action with this use and why this script dont work? (TFS 1.2)

function onUse(player, item, fromPosition, itemEx, toPosition)

player:canLearnSpell(Energy Wave)
player:learnSpell(Energy Wave)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end

i get this error

Lua Script Error: [Action Interface]
data/actions/scripts/606060.lua:eek:nUse
LuaScriptInterface::luaPlayerCanLearnSpell(). Spell "" not found
stack traceback:
[C]: in function 'canLearnSpell'
data/actions/scripts/606060.lua:3: in function <data/actions/scripts/606060.lua:1>

I think about any thing in the source. i dont know.
 
Solution
@mackerel i get same error. In fact the error does not appear in the notepad but also does not learn the spell.

I think about one error this function in the source. Omg.

If you have vanilla source then it should be ok.

Look here, this is the function in sources and that's what you should have in src/luascript.cpp

link

Make sure you also have the correct spell name in data/spells/spells.xml
Hi all,

I have one action with this use and why this script dont work? (TFS 1.2)

function onUse(player, item, fromPosition, itemEx, toPosition)

player:canLearnSpell(Energy Wave)
player:learnSpell(Energy Wave)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end

i get this error

Lua Script Error: [Action Interface]
data/actions/scripts/606060.lua:eek:nUse
LuaScriptInterface::luaPlayerCanLearnSpell(). Spell "" not found
stack traceback:
[C]: in function 'canLearnSpell'
data/actions/scripts/606060.lua:3: in function <data/actions/scripts/606060.lua:1>

I think about any thing in the source. i dont know.

LUA:
function onUse(player, item, fromPosition, itemEx, toPosition)
player:canLearnSpell("Energy Wave")
player:learnSpell("Energy Wave")
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)

return true
end
 
@mackerel i get same error. In fact the error does not appear in the notepad but also does not learn the spell.

I think about one error this function in the source. Omg.
 
Last edited:
@mackerel i get same error. In fact the error does not appear in the notepad but also does not learn the spell.

I think about one error this function in the source. Omg.

If you have vanilla source then it should be ok.

Look here, this is the function in sources and that's what you should have in src/luascript.cpp

link

Make sure you also have the correct spell name in data/spells/spells.xml
 
Solution
Back
Top