Hello, I am making a gui where I can send messages in the Roblox chat as: [System].
It doesn’t work sadly, here are my scripts:
Send Button:
local remote = game.ReplicatedStorage:FindFirstChild("FakeMessageRE")
local text = script.Parent.Parent.Message.Text
local Player = script.Parent.Parent.TextBox.Text
script.Parent.MouseButton1Click:Connect(function()
remote:FireAllClients()
print("Remote Fired")
end)
Message System which is in ServerScriptService:
local text = game.Players.LocalPlayer.PlayerGui.AdminMenu.FakeChat.Message.Text
local remote = game.ReplicatedStorage:FindFirstChild("FakeMessageRE")
local function SendSystemMessage()
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "[System]: " .. text;
Color = Color3.fromRGB(255, 255, 255);
Font = Enum.Font.SourceSansBold;
})
end
remote.OnClientEvent:Connect(SendSystemMessage())
I’ve tried many things. It was first in the frame itself, then I moved it to serverscriptservice and it still didn’t work. Any help would be appreciated.
you are doing OnClientEvent inside a server script, also
FireAllClients() in a local script? so what you want to do instead is when the player makes an input, send it to the server and have the server do FireAllClients() then in a local script, it will receive this
(also if i’m wrong and this is a local script already, still would not work since it’s in ServerScriptService, add it anywhere in the client side, maybe startergui?)
FireAllClients() in a local script? so what you want to do instead is when the player makes an input, send it to the server and have the server do FireAllClients() then in a local script, it will receive this
The remote did fire, which I tested using the print function. It’s just not saying the message in chat.
local PlayerGui = game.Players.LocalPlayer.PlayerGui
local text = PlayerGui.AdminMenu.Fakechat.Message.Text
local remote = game.ReplicatedStorage:FindFirstChild("FakeMessageRE")
remote.OnServerEvent:Connect(function()
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "[System]: " .. text;
Color = Color3.fromRGB(255, 255, 255);
Font = Enum.Font.SourceSansBold;
})
end)