Ad
Log in to vote
0

my bindable function is spitting out the error "attempt to call a nil value", Any help?

Asked by 5 days ago

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?

0
InvokeServer() greatneil80 2465 — 5d
0
@greatneil80 tried it, I still got the exact same error. I used OnServerInvoke too, still nothing. Also the intellisense didn't suggest it so I don't think this is it TheOof1sout 4 — 5d
0
at which line did the error occur? Gmorcad12345 272 — 5d
0
@Gmorcad12345 Yk for some weird reason the doesn't even say what script it's part of let alone what line it occurs at. all I know is that it occurs when i press enter in the textbox TheOof1sout 4 — 5d

Answer this question