So I have a problem with my script. When I fire this remote event it only shows for the client. Heres the scripts.
Local Script:
local rp = game.ReplicatedStorage
local remote = rp.Claim
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
print("Claimed")
script.Parent.Parent.FinishOrderFrame.Visible = true
script.Parent.Parent.FinishOrderFrame.Parent = player.PlayerGui.FinishOrder
remote:FireServer(script.Parent.Parent.Claimed, player, script.Parent, script.Parent.Parent)
end)
Server Script:
local rp = game.ReplicatedStorage
local remote = rp.Claim
remote.OnServerEvent:Connect(function(player, v, playername, z, x)
v.Text = "Claimed by: "..playername.Name
z.Visible = false
wait(5)
x:Destroy()
end)
Can anybody help me why the remote event only shows for the person who clicks on the GUI button?

11 comments
Thank you! I will try it later. I hope this will work!
No problem!
Just remember that you can change a gui on a client during the game, by accessing player.PlayerGui which will contain anything that was in the StarterGui
The server cannot access GUIs. That's on the Client. You can loop through all the players in the server just like what IceyTazeForLife is showing you here, but you cannot fire a RemoteEvent and expect the server to be able to access something that is on the Client. You can do this all in your one LocalScript or use a BindableEvent which allows server-server and client-client communication.
Here's a link if you want to learn about BindableEvents: https://developer.roblox.com/en-us/api-reference/class/BindableEvent#event-tuple-arguments-. However, RemoteEvents allow server-client communication and vice versa.
That is true because the client makes changes that the server does not know about so it's guaranteed to cause unknown behavior. But anyways in that script it didn't make much of a difference. Thanks for the feedback! I will be sure to use that from now on.
But also you can have some values in replicatedStorage and when the server updates those values, using :GetPropertyChangedSignal on the client you can see what the new value is and update the gui from a local script.
It looks like I've ran into a problem. Since the GUI will be cloned multiple times, the script will not know which GUI that needs the textlabel to be changed. Do you have any solutions to this?
Instead of accessing the player gui from the server, use a remote event and on the server, when someone claim's whatever, fire the remote to all the clients by doing event:FireAllClients(player.Name) and pick it up on the client to display the name of who claimed whatever.
Thank you! This worked!
No problem! :)