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

What is this error? {Found problem} {Not fixed}

Asked by 9 years ago

Edit: I realized that when I click the enter button, both of the functions fire. Any suggestions on how to fix this problem?

Something is wrong with one of these scripts (Guessing the second one)

I am making a chatbox, that only allows text that isn't "Chat here!" The error is, when I make text on the first box, and then I do another one for the second box, the first box gets the same text of the second box, but the 2nd box gets the same text, too.

So, how will I fix it so the text of the 2nd box isn't like the first box?

BOX #1:

box = script.Parent.Parent.ChatBox

script.Parent.MouseButton1Click:connect(function()
    if box.Text ~= "Chat here!" then
        script.Parent.Parent.C1.Text = script.Parent.Parent.Parent.Parent.Name..": "..box.Text
    end
end)

BOX #2:

box = script.Parent.Parent.ChatBox
script.Parent.MouseButton1Click:connect(function()
    if box.Text ~= "Chat here!" and script.Parent.Parent.C1.Text ~= "" then
        script.Parent.Parent.C2.Text = script.Parent.Parent.Parent.Parent.Name..": "..box.Text
    end
end)
0
I believe it should be "==" instead of "~=" woodengop 1134 — 9y
0
"~=" means not equivalent to. Redbullusa 1580 — 9y
0
i know :/ groovydino 2 — 9y
0
i dont want ==, i meant to use ~= :/ groovydino 2 — 9y

Answer this question