NikoLudloow Posted October 23, 2013 Posted October 23, 2013 ' attempt to compare number with nil ' Can anyone help me solve this problem? Line: function math.percentChance(percent, repeatTime) local hits = 0 for i = 1, repeatTime do local number = math.random(0, 200) / 2 if percent >= number then -- error line hits = hits + 1 end end return hits end
Guest Guest4401 Posted October 23, 2013 Posted October 23, 2013 percent is nil. You're not passing a number as first argument while calling the function.
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