Issue with local script to local script event communication

I’m trying to code a system where a local player triggers an event and the same event is replicated to all the player’s GUIs, however, I’m using the :Fire() method and when the local player fires it, the only player who gets the GUI event replicated is the one who fired it.

Basically I’m trying to find a way for a local script to use :FireAllClients() as a BindableEvent.

I’ve tried making a system where the local player triggers a Remote Event to the server and then the server triggers it back to all local players through :FireAllClients(), but that didn’t work.

1 Like

Clients cannont contact other clients without the server. This is just a safety issue with hackers and exploiters. Binable events are only meant for that client to communicate with that one and only client, in other local scripts, but never goes to the server to tell other clients about it.

Your going to have to use a Remote event to fix your issue

1 Like

It’s not working for me.

I made the following order of scripts:

LOCAL SCRIPT 1

if PlayerLoaded:WaitForChild("HasBeenActivated").Value == false then
	PlayerLoaded:FireServer()
	PlayerLoaded.HasBeenActivated.Value = true
end

SCRIPT 1

PlayerLoaded.OnServerEvent:Connect(function()
	PlayerLoaded:FireAllClients()
end)

LOCAL SCRIPT 2

PlayerLoaded.OnClientEvent:Connect(function()
	print("WORKEEEDD")
end)

The message isn’t getting printed

Add a couple more prints… and let me know what prints:

LOCAL SCRIPT 1

if PlayerLoaded:WaitForChild("HasBeenActivated").Value == false then
print("Sent To Server")
	PlayerLoaded:FireServer()
	PlayerLoaded.HasBeenActivated.Value = true
end

SCRIPT 1

PlayerLoaded.OnServerEvent:Connect(function()
print("Got signal... sending to clients..")
	PlayerLoaded:FireAllClients()
end)

LOCAL SCRIPT 2

PlayerLoaded.OnClientEvent:Connect(function()
	print("WORKEEEDD")
end)

Also Where is this Remote Event located? And where are the scripts located?

The remote event is located in ReplicatedStorage, both local scripts are located in the StarterGuis and the non-local script that fires all clients is located inside the remote event in the Replicated Storage

I tried your method and the only part who got printed was the first one! (Sent to server)

1 Like

Scripts aren’t fired in replicated storage. Move it to ServerScriptService!

3 Likes

Omg that worked!! Such a silly mistake lol, thanks a lot for helping! :smiling_face: :stuck_out_tongue:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.