I spent way too long on this. What I need is in the title. Here is what I tried:
-- Server Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat_Event = ReplicatedStorage:WaitForChild("Chat")
Chat_Event:FireClient("Text to chat")
-- Local Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat_Event = ReplicatedStorage:WaitForChild("Chat")
local function chat(msg)
game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(msg, "All")
end
Chat_Event.OnClientEvent:Connect(chat)
Basically in the server script I get this error: Unable to cast value to Object
When I searched it up I just found a post about the teleport service. How do I fix this? Also is the local script good, or I will just get another error.