Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Solved] Confused on "MouseButton1Click is not a valid member of TextBox" Help?

Greetings, as i type in a script:

LocalPlayer = game.Players.LocalPlayer
tableLots = script.Parent.Parent.Parent.TableLots

script.Parent.MouseButton1Click:Connect(function()
    local text = script.Parent.Parent.TableHandler.Text
    local number = tonumber(text)
    print("Number ", number)

    if number >= 1 and number <= 18 then
        local chosenTable = tableLots["Table"..tostring(number)]

        if(chosenTable.BackgroundColor3 == Color3.fromRGB(255,0,0))then
           script.Parent.Text = "Table already taken."
           wait(3)
           script.Parent.Text = "Please try again."
           wait(3)
           script.Parent.Text = "Submit"
        else
            chosenTable.BackgroundColor3 = Color3.fromRGB(255,0,0)
        end
    else
        script.Parent.Text = "There are only 18 tables.\n Please enter another table number."
    end
end)

I get an error: 10:21:39.429 - MouseButton1Click is not a valid member of TextBox

Can anyone help me?

3 comments

0

Never seen this type of an error, that's unfortunate.

1

MouseButton1Click is not a valid signal on TextBox. Use a TextButton

1

@NiniBlackJackQc Mind if you make an answer? It works.

1 answer

MouseButton1Click is not a valid signal on TextBox. Use a TextButton

Composed by@NiniBlackJackQc

This discussion is preserved as it was. New answers, comments, and votes are closed.