FireAllClients Not Working?

I’m currently scripting a DialogueChange module but something doesn’t seem to be working, the ModuleScript printed out “ModuleTest” so I know that it worked, but something’s wrong with my LocalScript or maybe FireAllClients that I can’t seem to work out. The output doesn’t have any errors so I’m not sure what’s wrong with the script, I used this exact method on another module and it seemed to work fine.

Screenshot_646
Screenshot_647

--LocalScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Dialogue = ReplicatedStorage:FindFirstChild("Dialogue")


function Change()
	print("Remote Test")
end

Dialogue.OnClientEvent:Connect(Change)

--ModuleScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Dialogue = ReplicatedStorage:FindFirstChild("Dialogue")

local module = {}

module.DialogueChange = function() 
	
	Dialogue:FireAllClients()
	print("ModuleTest")
end

return module

--MainScript

local DialogueModule = require(script.Parent.DialogueModule)

DialogueModule.DialogueChange()

My only guess is that your client did not load in time to receive this event. Is it fired once the server starts?

7 Likes

Whoops, I overlooked this possibility thanks lol. I tested it with a wait statement and it worked fine.