my bad if the title might seem a little confusing, but im trying to make a textbox that can support negative numbers, decimals and positive numbers, ive already implemented it so it only supports numbers negative symbols and decimals but my problem is that you can type the negative symbols more than twice same thing with a decimal

which leads into that

i dont know how to make it to limit certain characters so thats what I need help with

this is my current script

```
Parent.X:GetPropertyChangedSignal("Text"):Connect(function()
Parent.X.Text = Parent.X.Text:gsub("[^%d%.%-]", '')
end)
```