xXMADEXx Posted June 9, 2013 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
DiSaMe Posted June 9, 2013 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.
xXMADEXx Posted June 9, 2013 Author Posted June 9, 2013 oh wow, i forgot to update the distance (facepalm) fail. Thanks
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