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 fire a remote event from ServerScriptService to a local script?

I have a script in ServerScriptService and I need it to fire a remote event that a local script will get so that it can know to change a GUI element.

2 answers

You can use :FireClient() to fire an event to a specific player

game:GetService("ServerScriptService").RemoteEvent:FireClient(player)
--Wherever the remote event is

The first parameter MUST be a player object in order for it to work

2 comments

0

Also use RemoteEvent.OnClientEvent:Connect(function() to listen for the event to fire.

0

Lmao

To appropriately engage this, you must establish a medium in which both ends of the network can access. The commonplace for RemoteEvent's is ReplicatedStorage when hoping to communicate between the Client & Server.

####If you already have an existing Remote designated within ServerScriptService, this will need to be moved as this container is inaccessible to the Client.


As usual, we use the :FireClient() method to send our data, subsequently using the .OnClientResponse signal to receive.

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