Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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?

0
Never seen this type of an error, that's unfortunate. popu2004 42 — 4y
1
MouseButton1Click is not a valid signal on TextBox. Use a TextButton NiniBlackJackQc 1562 — 4y
1
@NiniBlackJackQc Mind if you make an answer? It works. raid6n 2196 — 4y

1 answer

Log in to vote
1
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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

Composed by@NiniBlackJackQc

Ad

Answer this question