xXMADEXx Posted June 9, 2013 Share Posted June 9, 2013 (edited) Hey guys, im making my hospital respawn system, and for some reason it just keeps selecting the last index of the table. Im not really sure why it does this, but i've tried everything to fix it. Please help. [[ REMOVED BY xXMADEXx ]] Edited June 9, 2013 by Guest Link to comment
DiSaMe Posted June 9, 2013 Share Posted June 9, 2013 This: local distance = 9999999 And this: if ( dist < distance ) then Since distance is always 9999999, you keep checking distance to every hospital against 9999999, which will always be true, therefore the result will be the one which is the last on the list. Link to comment
xXMADEXx Posted June 9, 2013 Author Share Posted June 9, 2013 oh wow, i forgot to update the distance (facepalm) fail. Thanks Link to comment
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