Closed spectrenoir06 closed 8 years ago
Your code throws an error in Lua. You probably want to reverse the arguments to math.random
if you're trying to get a random number between -100 and 100. You will see similar errors when running your game using the native love executable.
Thank's for the short response
I have understand the probleme i'ts because love.js use standart Lua and Löve use luaJIT
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> print(math.random(100,-100))
stdin:1: bad argument #2 to 'random' (interval is empty)
stack traceback:
[C]: in function 'random'
stdin:1: in main chunk
[C]: in ?
LuaJIT 2.0.3 -- Copyright (C) 2005-2014 Mike Pall. http://luajit.org/
> print(math.random(100,-100))
-59
@spectrenoir06 Ah, very true. That's pretty weird. Thanks for figuring that out!
Hello i have encounter a strange error with math.random(100, -100)
Error
Weapon.lua