Hi there! I'm having a problem with a remote event, attached to a local script. Here is a script that assigns GUI to the player (on server) , when their character is loaded:
GUI = game.ReplicatedStorage.GUI:GetChildren()
if #player.PlayerGui:GetChildren() < 2 then
for i = 1,#GUI do
GUI[i]:Clone().Parent = player.PlayerGui
end
else
game.ReplicatedStorage.LocalScript.RemoteEvent:FireClient(player)
end
...this works fine. I've tested it multiple times and, accordingly, the script works. The problem is that the local script (that assigns GUI to the client) doesn't fire the event:
script.RemoteEvent.OnClientEvent:Connect(function(player)
GUI = game.ReplicatedStorage.GUI:GetChildren()
for i = 1,#GUI do
GUI[i]:Clone().Parent = game.Players.LocalPlayer.PlayerGui
end
end)
Any help? I really appreciate it, thanks!

6 comments
^ How does it know what client to fire?
The fire client only works with the player parameter, I've tested it
I don't know what you mean by "how does it know what client to fire"?
Just to help you with organization, typically people put all RemoteEvents/Functions in the ReplicatedStorage, Local Scripts in the ReplicatedFirst or StarterPlayer, and Scripts in the ServerScriptService/Decendant of Workspace
My bad
You're good, no worries. Thanks for the help!