I was making a textbox where only numbers could be written, but I noticed that negative numbers could not be written, so - symbol could not be used, can you help me?
local Script = script
local TextBox = Script.Parent
local function OnTextChanged()
TextBox.Text = string.gsub(TextBox.Text, "[^%d%-%.]", "")
end
TextBox:GetPropertyChangedSignal("Text"):Connect(OnTextChanged)