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

Present Objects Errored as "Nil"?

Asked by 5 years ago

I've been coding a message gui for a little while, and i've gotten an issue at this point. it's claiming that TEXT isn't a valid member of a TextBox. Remote code:

CreateMessage = function(text, color, font, size)
    game.StarterGui:SetCore("ChatMakeSystemMessage", {
    Text = text;
    Color = color;
    Font = font;
    FontSize = size;
    })
end
script.Parent.RemoteEvent.OnServerEvent:Connect(function(route1)
    CreateMessage("["..script.Parent.Name.Text.."]:"..tostring(script.Parent:FindFirstChild("TextBox").Text),Color3.fromRGB(255,255,255),"Arcade",25)
end)

Button code:

script.Parent.TextBox.FocusLost:Connect(function(enter)
    if enter then
        script.Parent.RemoteEvent:FireServer()
    end
end)
0
What is your error exactly? chexburger 358 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

it should have been:

CreateMessage = function(text, color, font, size)
    game.StarterGui:SetCore("ChatMakeSystemMessage", {
    Text = text;
    Color = color;
    Font = font;
    FontSize = size;
    })
end
script.Parent.RemoteEvent.OnServerEvent:Connect(function(route1)
    CreateMessage("["..script.Parent.Name,"]:"..tostring(script.Parent:WaitForChild("TextBox",100).Text),Color3.fromRGB(255,255,255),"Arcade",25)
end)

I guess? I mean. It's that simple

0
It only sparked up more issues in the code. "Invalid value for enum Font" Professor_Hew 10 — 5y
0
Did it atleast remove the old errors? "Invalid value for enum Font" would be on line 5 which I don't know what's wrong with it mixgingengerina10 223 — 5y
Ad

Answer this question