Hello,
I noticed that if RemoteEvent:FireClient() is ran before the player connects using OnClientEvent, then the next time the player connects using OnClientEvent it will be run immediately. This caused me some issues when trying to disconnect the connection.
Here is an example:
--In server script
local Remote = Instance.new("RemoteEvent")
Remote.Name = "MyRemote"
Remote.Parent = game.ReplicatedStorage
Remote.OnServerEvent:Connect(function(Player)
Remote:FireClient(Player)
end)
--In Client Script
local Remote = game.ReplicatedStorage:WaitForChild("MyRemote")
Remote:FireServer()
wait(1)
local Connection
Connection = Remote.OnClientEvent:Connect(function()
Connection:Disconnect() -- This will error because Connection is nil
end)
This only happens if Workspace.SignalBehavior is set to Default