i was working on a code system for my game using a serverscript in the gui button it is not working!
my script is not printing “Code Test” when i type “Test” in the textbox and i click the button no work
script.Parent.MouseButton1Click:Connect(function()
local textBox = script.Parent.Parent.TextBox
if textBox.Text == "Test" then
print("Code test")
end
end)
Whenever you type text into a TextBox, that typed text is only available on the client. Therefore, you need to have a local script which would transmit the text to the server, and the server would then process that text.
In the client script, you would fire the RemoteEvent with the textbox’s text.
In the server script, you would connect to OnServerEvent and then process that text (in your case check if it is equal to Test) and do the appropriate actions.