Hey, I am working on my newest plugin, Logs Pro, but theres a problem with printing out the text is in a text box. It just prints “nil” even though there are numbers in the input. I have tried this without the tonumber by the way. Here is a part of the code.
local Number = math.random(100000, 999999)
print(Number)
local rNumber = Number
print(rNumber)
JoinScreen.Visible = false
VerifyScreen.Visible = true
local inputCode = tonumber(VerifyScreen.Input.Text)
local sumbitCode = VerifyScreen.Submit
sumbitCode.MouseButton1Down:Connect(function()
print(inputCode)
I have to rush sort of right now, so if anyone could help me, it would be amazing. Thanks!
do you have an end statement at the end of ur function, based off the code im assuming it wouldnt work, but assuming you do it seems like it should be okay
Have you tried placing the variable inside the event?
local Number = math.random(100000, 999999)
print(Number)
local rNumber = Number
print(rNumber)
JoinScreen.Visible = false
VerifyScreen.Visible = true
local sumbitCode = VerifyScreen.Submit
sumbitCode.MouseButton1Down:Connect(function()
local inputCode = tonumber(VerifyScreen.Input.Text) -- here
print(inputCode)
This will grab the most current text from the TextBox when the event is fired. What you were doing previously was getting the text when this section of the script initially runs, meaning, it will stay as nil since that’s what the inital textbox text was.