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?
COMMUNITY QUESTION
How do I make a local script work for the server?
1 answer
If your game is FilteringEnabled, you'll need to use a RemoteEvent.
--Server Code
local re = game.ReplicatedStorage.RemoteEvent
local sound = script.Parent
re.OnServerEvent:Connect(function(player)
sound:Play()
end)
--Client Code
local re = game.ReplicatedStorage.RemoteEvent
local button = script.Parent
button.MouseButton1Down:Connect(function()
re:FireServer()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
thanks