• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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