j03l1370 Posted March 31, 2023 Share Posted March 31, 2023 Hi, I am trying to generate a random number in a range with the function math.random() and when i use the math library it gives me the error that is in the image. I think it could be some sort of problem with Java and the way it interpret Lua but i'm not really sure if could be that Link to comment Share on other sites More sharing options...
Squall4120 Posted April 4, 2023 Share Posted April 4, 2023 Use ZombRand() This post explains how to use it: Hugo Qwerty and j03l1370 1 1 Link to comment Share on other sites More sharing options...
j03l1370 Posted April 4, 2023 Author Share Posted April 4, 2023 Thanks! ngl i been trying using the math function because in some files of the game uses this function but well i think it doesnt work well for the mods. Thanks again! Link to comment Share on other sites More sharing options...
DaveGT Posted April 26, 2023 Share Posted April 26, 2023 (edited) On 3/31/2023 at 3:04 PM, j03l1370 said: Hi, I am trying to generate a random number in a range with the function math.random() and when i use the math library it gives me the error that is in the image. I think it could be some sort of problem with Java and the way it interpret Lua but i'm not really sure if could be that I found some info on the internet. Maybe this will help you. First you need to include the "math" module with the "require('math')" command. You can then use the "math.random()" function, which will generate a random number between 0 and 1. Also searched for mathematics, and used https://phdessay.com/free-essays-on/mathematics/ to more detailed knowledge. If you have any questions or problems, feel free to ask for help! I really enjoy helping people. I feel after the news that I helped someone is simply unrealistic. Even if I do not understand this, I am ready to read and find out what you need. require('math') will help? Edited May 1, 2023 by DaveGT Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now