Jump to content

Weird table selection bug


Recommended Posts

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 by Guest
Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...