I am trying to make a local script that when we click a button, it will change to an echo to the whole game so that everyone can here it and I cant make a textbutton work with a regular server script, so any help please?
If your game is FilteringEnabled, you'll need to use a RemoteEvent.
1 | --Server Code |
2 |
3 | local re = game.ReplicatedStorage.RemoteEvent |
4 | local sound = script.Parent |
5 |
6 | re.OnServerEvent:Connect( function (player) |
7 | sound:Play() |
8 | end ) |
1 | --Client Code |
2 |
3 | local re = game.ReplicatedStorage.RemoteEvent |
4 | local button = script.Parent |
5 |
6 | button.MouseButton 1 Down:Connect( function () |
7 | re:FireServer() |
8 | end ) |