I have a remote event going from a server to a client. It doesn't seem to work as I don't receive any output from the print function on the local script.
This is the server script.
ReplicatedStorage = game.ReplicatedStorage dialogEvent = ReplicatedStorage.dialogEvent dialogEvent:FireAllClients()
This is the local script.
ReplicatedStorage = game.ReplicatedStorage dialogEvent = ReplicatedStorage.dialogEvent function onDialogEventFired() print("finally") end dialogEvent.OnClientEvent:Connect(onDialogEventFired)
Likely isn't working because not everything in the game hasn't loaded in yet. I added GetService on ReplicatedStorage, and a WaitForChild for the event itself just to make sure they loaded in, also added a wait() right before firing the event and it worked.
Server Code:
ReplicatedStorage = game:GetService("ReplicatedStorage") dialogEvent = ReplicatedStorage:WaitForChild("dialogEvent") wait() dialogEvent:FireAllClients()
Client Code:
ReplicatedStorage = game:GetService("ReplicatedStorage") dialogEvent = ReplicatedStorage:WaitForChild("dialogEvent") function onDialogEventFired() print("finally") end dialogEvent.OnClientEvent:Connect(onDialogEventFired)
The things I added shouldn't delay the code enough to mess anything important up.