Hello everyone! While developping my game I noticed that my local scripts which handle server requests send 2 messages in one use. I thought it was the server script’s problem which fires :FireAllClients() 2 times, but after making one script which makes one request client script still had 2 requests to handle. What could possibly cause this problem?
Server-sided script in workspace:
wait(5)
game:GetService("ReplicatedStorage").RemoteEvents.PlaySound:FireAllClients(1,"SyringePush","Tool",{Parent=workspace,RollOffMaxDistance=50})
Client-sided script:
local rs = game:GetService("ReplicatedStorage")
local soundModule = require(game:GetService("Players").LocalPlayer.PlayerScripts:WaitForChild("ModuleScripts").SoundModule)
rs.RemoteEvents.PlaySound.OnClientEvent:Connect(function(id,soundKey,group,parameters)
print("Create sound request")
local sound = soundModule.CreateSound(id,soundKey,group,parameters)
soundModule.PlaySound(sound,true)
end)
the workspace:
And output (First 4 lines, other are mine scripts which also have this problem)
Note: This problem also happens to other scripts, not only soundscript