Hello, I'm trying to make a bindable function that after the player clicks on the text box, types something in, and then clicks enter/return it stores the word in the server and then prints it in the output. Now everything on the typing side works, It even prints out on a surfacegui. The problem is that if I try to run the code I get the error "attempt to call a nil value". Here's my code.
local screenTextBox = script.Parent -- Location of Textbox on the screen local partTextLabel = game.Workspace.BlueTeamGameRoom.BlueGameBoard.Board.SurfaceGui.TextBox -- Location of text on block local gui = script.Parent while true do wait(.5) screenTextBox.FocusLost:connect() partTextLabel.Text = screenTextBox.Text -- Change text end screenTextBox.FocusLost:connect(function(enterPressed) if enterPressed then -- Make sure they loose focus due to enter press local DBallz = game.ReplicatedStorage.answerVerify:Invoke() print(DBallz) end end)
Does anyone have any clue why?