[Solved] Lua Modulo Weird Behavior

Status
Not open for further replies.
Level 3
Joined
Dec 9, 2014
Messages
18
Hello! I'm writing out some scripts but it seems like when I try to run a modulo I get some weird behavior, for example:

a % b - Causes a syntax error
a % n - Crashes the world editor
a % 1 - Saves fine

Are we not able to use variables with the mod functionality?

Full Example that gives a syntax error:

Lua:
  local function mod(a, b)
    return a % b
  end

Gives following syntax error:
1678004348626.png


I tried to do a little searching and did discover that the % sign can cause crashing but that looks like with string concatenation, is this a similar problem?

Thank You!
 
Status
Not open for further replies.
Top