LocalScript in StarterGui won't receive RemoteEvent

I have a ServerScript in the Workspace and a LocalScript in every player’s PlayerGui (StarterGui).

Server Code:

local event = game.ReplicatedStorage.Events.Map
local cards = drawCards()       --Gets a variable called "cards" from a function
event:FireAllClients(cards)
print("Event Fired")                 --PRINTS SUCCESSFULLY

Client Code:

local receive = game.ReplicatedStorage.Events.Map
receive.OnClientEvent:Connect(function(cards)
	print("received")              --DOESN'T GET PRINTED, SOMEHOW.
end)

“Received” doesn’t show up in the output but “Event Fired” does.
Ignore any typos as Studio is showing 0 syntax errors.

Help is greatly appreciated, thank you.

I’ve only showed the relevant parts, these two are snippets of a much larger system of scripts. If need be I’ll send more

I made a new localscript in StarterGui with this code:

game.ReplicatedStorage.Events.Map.OnClientEvent:Connect(function()
	print("yes2")
end)

Still doesn’t work, so the problem is 100% the fact that LocalScript can’t pick up on Remote Events inside StarterGui

Does the server fire events right at the start of the game? In that case the player might have not loaded yet and doesn’t receive the event because of that

Wow I never knew that the player loaded after the game when a Server was created
Thanks a ton dude, it worked.

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