I have a TextBox and I need to check if the player has input integer (no letters or special symbols)
Something like:
if (string.isInteger) == true/false
local isaint = tonumber(script.Parent.Text) if isaint then -- valid number else --invalid number end
function isInt(var) if type(var) = "int" then return true else return false end end
The simplest and most performant solution is to attempt to round the number then compare, if it's an integer it'll be equivelant.
local function isInteger(num) if math.floor(num) == num then return true end return false end