Answered by
8 years ago Edited 8 years ago
If you're using FilteringEnabled (and possibly even if you're not, I'm not sure), you will need to have RemoteEvents. Assuming your RemoteEvent is in the workspace and is named RelayMessage
, something like this:
2 | workspace.RelayMessage.OnServerEvent:connect( function (sender, target, msg) |
3 | workspace.RelayMessage:FireClient(target, msg) |
2 | workspace.RelayMessage.OnClientEvent:connect( function (msg) |
6 | workspace.RelayMessage:FireServer(somePlayer, someMsg) |
Note: a proper server-side function might make sure of the following things to prevent exploiters/hackers from doing too much damage:
- That the message is appropriate and not ridiculously long (ex it could be a number referring to a pre-made message if you wanted to be 100% safe)
- That the sender isn't spamming people or the server using a bot (if they are, you should kick them)