• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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