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

TFS 0.X Spell with a params

  • Thread starter Thread starter Xikini
  • Start date Start date
X

Xikini

Guest
Short and sweet, I've been searching for a few hours and not having much luck.

Wanted Result;

Player says
Code:
test_spell test
test_spell 'test
test_spell "test
console prints
Code:
test
test
test

I have this in spells.xml (assuming it's required, as spells such as levitate use it)
LUA:
params="1"
LUA:
<instant name="test_spell" words="test_spell" mana="0" exhaustion="1000" groups="4,1000" icon="57" params="1" needlearn="0" event="script" value="test_spell.lua">
</instant>
LUA:
function onCastSpell(cid, var)
    local text = var.type
    --local text = var.number
    --local text = var.text
    --local text = variantToString(var.type)
    --local text = variantToString(var.number)
    --local text = variantToString(var.text)
    print(text)
    return true
end
Everything I've tried thus far either prints nothing, or throws errors.
'attempt to index a number value'
'attempt to concatenate a local 'text' (a nil value)'

among others.

I'm not even sure what to try at this point.

Can someone point me in the right direction?

Xikini
 
Back
Top