The structure of your script checks out, but you're not checking to see if things exist before calling/writing to them.
I've done a little example (ill paste the script(s) here at the end of this answer for reference)
The code I've written checks to see if our gui elements exist before printing. If they do exist, then continue as normal if they don't exist. For example, if we misspelled LineFour as LneFour or even linefour then the code will tell you that this doesn't exist in your display(s) and lets you know what display its missing.
Modified Code as follows:
ServerCode:
local RadioRemoteEvents = game.ReplicatedStorage.RadioRemoteEvents
local RadioEvent = RadioRemoteEvents.RadioEvent
function DisplayMessage(Frame,Message)
local LineOne = Frame:FindFirstChild("LineOne")
local LineTwo = Frame:FindFirstChild("LineTwo")
local LineThree = Frame:FindFirstChild("LineThree")
local LineFour = Frame:FindFirstChild("LineFour")
local LineFive = Frame:FindFirstChild("LineFive")
local LineSix = Frame:FindFirstChild("LineSix")
local CheckTble = (function()
local Tab = {LineOne,LineTwo,LineThree,LineFour,LineFive,LineSix}
local RetTab = {}
for k,v in pairs(Tab) do
if(v ~= nil) then
RetTab[#RetTab+1] = v
end
end
return RetTab
end)()
if(#CheckTble ~= 6) then
return
error("Error: Malformed Display in "..tostring(Frame)
.." \n Object location = "..tostring(Frame:GetFullName())
.." !")
end
LineSix.Text = Frame.LineFive.Text
LineFive.Text = Frame.LineFour.Text
LineFour.Text = Frame.LineThree.Text
LineThree.Text = Frame.LineTwo.Text
LineTwo.Text = Frame.LineOne.Text
LineOne.Text = Message
end
function ConfigMessage(Player,Message,Channel)
local RadioGui = script.Parent
local Frame = RadioGui.RadioFrame:FindFirstChild(Channel)
if(Channel ~= nil) then
local ConfiguredMessage = Player.Name..": "..Message
DisplayMessage(Frame,ConfiguredMessage)
else
error("Channel["..tostring(Channel).."] Does not exist in 'RadioGui.RadioFrame'!")
end
end
RadioEvent.OnServerEvent:Connect(function(Player,Message,Channel)
ConfigMessage(Player,Message,Channel)
end)
PlayerGui (Local Script) Code:
local TextBox = script.Parent.TextBox
local SubmitBtn = script.Parent["Submit Button"]
local EventCaller_Storage = game:GetService("ReplicatedStorage")
local EventCaller_FDR = EventCaller_Storage:WaitForChild("RadioRemoteEvents",10)
local EventCaller = EventCaller_FDR:WaitForChild("RadioEvent",10)
SubmitBtn.MouseButton1Click:Connect(function()
local Message = TextBox.Text
EventCaller:FireServer(Message,"Channel One")
end)
Hope this helps! :)