This is what I have so far but it always says its a string and I dont know how to check if its a string or number anyone know how to fix this??
01 | local text = script.Parent |
02 |
03 |
04 | text:GetPropertyChangedSignal( 'Text' ):Connect( function () |
05 | if type (text.Text) = = 'string' then |
06 | print ( 'This text is a string' ) |
07 | elseif type (text.Text) = = 'number' then |
08 | print ( 'This text is a number' ) |
09 | end |
10 | end ) |
For those who might be wondering, here's how to check if a string can be evaluated as a number:
1 | local myString = "1.23" |
2 | local myNumber = tonumber (myString) |
3 |
4 | if ( type (myNumber) = = "number" ) then |
5 | -- do something with myNumber |
6 | else |
7 | -- myString cannot be evaluated as a number |
8 | end |