Here is how to fix it simply.
Before I move on, I just want to clear everything out:
- Local Scripts are not broken.
- The Framework could be done on the Local Script.
Now here’s how you do this:
Firstly, you want to make a Remote Event under your Local Script. You want to make a ServerScript in ServerScriptService and type this:
wait(.2);
function Framework(Msg, Plr)
for i,plrs in pairs(game.Players:GetChildren()) do
plrs.StarterPlayer.StarterPlayerScripts.Chat.Chatted:FireAllClients(Msg, Plr) -- Your RemoteEvent
end
end
while wait() do
for i,plrs in pairs(game.Players:GetChildren()) do
plrs.Chatted:Connect(function(Msg, Plr)
Framework(Msg, Plr)
end)
end
end
What this will do, is it will detect when a single player has chatted, and when they have chatted, it will fire your remote event, but we now have to detect when that is fired, So in your local script, clear everything, and write this:
wait(.2);
script.Chatted.OnClientEvent:Connect(function(Msg, Plr)
print(Plr.Name .. ': ' .. Msg)
end)
It will detect whenever the player has chatted, then it will get there Message and Player, then it will print as an example: “Player1: Hi”
You have to utilize the script to your event parent and script parent. Just make sure it’s right, because if it’s not the script wont work and it’s not my fault.