Hi everyone!
I’m trying to create an in-game messaging system that staff members in a group can use, but I’m having some trouble, I can’t seem to figure out.
When the event is fired to send a message, it thinks the “Message” part is the “Player” part, even though it knows the player part is the message?
Here’s a screenshot from in the game and the code. Please help fix this!
Note: I know that it thinks its the player as I had it print the Message Result as a string and it sent my name.
Client Sided:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local AnnouncementOpen = true
local Box = script.Parent.MessageFrame.TXTBox
script.Parent.AnnounceBtn.MouseButton1Down:Connect(function()
if AnnouncementOpen == false then
script.Parent.AnnounceFrame.Visible = true
AnnouncementOpen = true
else
script.Parent.AnnounceFrame.Visible = false
AnnouncementOpen = false
end
end)
Box.FocusLost:Connect(
function(Enter)
if Enter then
print(Box.Text)
local Text = Box.Text
game.ReplicatedStorage.RemoteEvent:FireServer(Player, Text)
end
end)
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(Player, Message)
local Message = script.MessageTemplate:Clone()
Message.MessageTemplate.Text = tostring(Message)
Message.PlayerName.Text = Player.Name
Message.Parent = script.Parent.MessageFrame.ScrollingFrame
end)
Server Sided:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player, Message)
if not Message then
print("No Message")
return
end
game.ReplicatedStorage.RemoteEvent:FireAllClients(Player, Message)
end)
Screenshot:
(posthanix is my username, the “MessageTemplate” is the default unchanged template text.

So sorry if this is a bother!
