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

TFS 0.X Spell with a params

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,834
Solutions
585
Reaction score
5,424
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