I am trying to make a game where the player fills in 2 TextBoxes and click a button and then it gives them a custom answer that I can edit in. But the Text Properties are not changing when the player fills in the 2 TextBoxes. Here is the code:
local player = game.Players.LocalPlayer
local screenGui = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui")
local textBox1 = screenGui:WaitForChild("TextBox1")
local textBox2 = screenGui:WaitForChild("TextBox2")
local enterButton = screenGui:WaitForChild("Enter")
local answerLabel = screenGui:WaitForChild("Answer")
local customAnswer = "success"
enterButton.MouseButton1Click:Connect(function()
local text1 = string.lower(textBox1.Text)
local text2 = string.lower(textBox2.Text)
if text1 == "test" and text2 == "Test" then
answerLabel.Text = customAnswer
else
answerLabel.Text = "error"
end
end)