Math.min has a red underline?

I’m trying to return the lowest number from a table

local LowestDistance = math.min(unpack(Distances))

However, I get a red underline, saying
‘This function must be called with self. Did you mean to use a colon instead of a dot?’ but a colon also shows a red underline. So what’s the correct function?

math | Documentation - Roblox Creator Hub shows math.min, so to me it should still work?

number math.min ( number x, number … )
Returns the minimum value among the numbers passed to the function.

1 Like

when i pasted this i did not get any red underline

Are you using the new Lua script analysis features in Beta Features? Try turning it off and see if you still get the red underline.

1 Like

Yeah that is it. Was barely gonna press reply but you beat me. It’s still in beta so there are still some bugs

1 Like