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

[Help] Matrix debug

SaLeM

New Member
Joined
Oct 14, 2007
Messages
97
Reaction score
0
Location
Spain
[SOLVED] Matrix debug

Hi, whenever I try to use this matrix on a lua script, my server restarts and I dunno why:

PHP:
  mt = {
        {1, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0}
      }

    text = mt[1]
        doPlayerSendTextMessage(cid,TALKTYPE_PRIVATE,text)

In theory, the text displayed should be:

1

Why, then, does my server crash?

ty
 
Last edited:
Hi, whenever I try to use this matrix on a lua script, my server restarts and I dunno why:

PHP:
  mt = {
        {1, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0},
        {0}
      }

    text = mt[1]
        doPlayerSendTextMessage(cid,TALKTYPE_PRIVATE,text)

In theory, the text displayed should be:

1

Why, then, does my server crash?

ty

Because then the code should look like this:
PHP:
  mt = {1, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0,
        0}

    text = mt[1]
        doPlayerSendTextMessage(cid,TALKTYPE_PRIVATE,text)
 
I LOVE YOU! xD xD

It worked, anyway I would want to know (just curiosity) why the mine one didn't work, given that the example was taken from a rune's script:

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 15)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)

local arr = {
{1, 0, 0, 1, 0, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 0, 1, 0, 0, 1}
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

You see? So I cannot explain myself what's the difference.

Thanks!
 
Because its using multiple tables inside 1 table, i just removed the other tables and placed everything inside one.
Heres some examples:
yours:
PHP:
table = {{THIS IS table[1][1]}{THIS IS table[1][2]}}
mine:
PHP:
table = {THIS IS talbe[1]}
I simple removed the { and the } in the start and end of all the lines inside the mt var, but not the one after the = and the last one.
 
Last edited:
Back
Top