Skip to main content
Finds the nearest keyhanger, optionally filtered by distance and model. Only enabled keyhangers are searched.
ArgumentData TypeNeededDefaultDescription
coordsvector3❌nilThe coordinates to search from, if nil the distance is ignored and a matching keyhanger is returned
distancenumber❌nilThe maximum distance from coords, if nil there is no limit
modelstring❌nilOnly match keyhangers of this model, if nil every model is matched
TypeDescription
number | nilThe id of the nearest matching keyhanger, or nil if none was found