I want to make a keypad code, so how do I reset the code it the amount of digits in the value is > than 3?
How many digits?
Well, you need to use string.len
If the value is only digits, then you can get the length of the value, which will tell you how many digits there are.
Here's an example:
local Number = 73948329 local Digits = string.len(tostring(Number)) print(Digits)
I'm not a 100% sure on if this works, but try this:
local value = script.Parent.Digits.Value if #value > 3 then print("Your code here") end
Closed as Non-Descriptive by fredfishy, MageMasterHD, and Leamir
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?