Hello everyone, I’m making a speedrun system for my game and I want to make the value change depending on the end time in the TextLabel. I don’t know why, but the timer stops but the value does not change at all. I will be very grateful for your help. Here’s the script:
Because you can’t set a number value to a string value and you would have to do add the tonumber() and put the rest of the code in the line which is this part:
I hope this somewhat explains this. I learned this when in a quick sort algorithm I made where I was trying to get the number in a text box and change a certain value based off of it.
Then it should print nil if there is no string value inside of the textlabel. This means that when it is printing the text value of the label is empty, so its printing nil. Also got to go to my next period now so for a couple minutes I might not respond
so it works. Also you dont have to put tostring before it because it automatically will print the string. Also it must be something with the tonumber because if its printing nil somethings wrong.
Here is a link to using tostring and tonumber that you can read and hopefully get a little more information on why its not working because I don’t know.
I have an idea why. Because tonumber only works if every part of the string is a number, putting the colons breaks it and makes it print nil. You are going to have to find some way to make it so that the actual time values are printed in between them by using I think this
I don’t know if its necessary for the decimal to have it around it but I guess that you could use some approach similar to this for changing the text or something. You may be able to make a second text label that holds those characters that you layer over it to make it so that it looks the same.