Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a local script work for the server?

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?

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)

1 comment

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.