Any ETA on when this hotfix is being released?
Tomorrow, or maybe tonight. Sorry for the wait, kind of busy irl.
Okay so Iâve been using this module for quite some time and it has been working fine. Sometimes, it just randomly gives these errors and it just keeps spamming them and all of the bridges stop working.
Any fixes or something that Iâve been doing wrong?
Can you send me a reproduction place so I figure this out?
I figured out what the problem was.
I was firing a bridge inside of a touched event like so:
if hit.Parent:FindFirstChild("Humanoid") then
Rewind:FireTo(game.Players:GetPlayerFromCharacter(hit.Parent))
end
I had a dummy in my game and when the touched ran on that dummy, the touched event tried to fire the bridge to the player of the respective character but the player didnât exist hence it started giving the error. I just added a check to see if there is a player for that instance and if there was then I ran the :Fireto.
This fixed the problem. But it would be epic if it didnât spam the output with an error continuously.
The error can be replicated by trying to fire to a player instance which doesnât exist through the server like so:
Bridge:FireTo(game.Players:GetPlayerFromCharacter(game.Workspace.Part))
-- spams the error ReplicatedStorage.BridgeNet.ServerBridge:125: table index is nil
When you try to Fire to another instance then this happens:
(Still spams like crazy)
Bridge:FireTo(game.Workspace.Brick)
-- spams the error FireClient: player argument must be a Player object
The mistake was being made on my end, but it would be very epic if the error wasnât spammed and the script didnât stop working as a whole.
Or maybe something that tells you which line is causing the error to occur
Unfortunately I wasnât able to make the release before leaving. However, you should be able to do game:Get service("ReplicatedStorage"):WaitForChild("RemoteEvent")
before doing .Start and it might fix it.
Hello! :Disconnect() is having some trouble rn. If you do disconnect sometimes it will disconnect the wrong connection.
I think I have a fix for this
Doesnât your system not use RemoteEvents?
It does use RemoteEvents, however it uses them in a way that takes less data.
Do you think the update will come out by next week?
How is this not working? I followed the documentation and It doesnât create the ping stats for me:
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = ReplicatedStorage:WaitForChild("Storage")
local Modules = Storage:WaitForChild("Modules")
local BridgeNet = require(Modules:WaitForChild("BridgeNet"))
local CreatePingStats = BridgeNet.CreateBridge("CreatePingStats")
CreatePingStats:Fire()
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = ReplicatedStorage:WaitForChild("Storage")
local Modules = Storage:WaitForChild("Modules")
local BridgeNet = require(Modules:WaitForChild("BridgeNet"))
local CreatePingStats = BridgeNet.CreateBridge("CreatePingStats")
CreatePingStats:Connect(function(player)
if player:FindFirstChild("leaderstats") then return end
local PingFolder = Instance.new("Folder")
PingFolder.Parent = player
PingFolder.Name = "leaderstats"
local Ping = Instance.new("StringValue")
Ping.Parent = PingFolder
Ping.Name = "Ping"
end)
(I start BridgeNet on the client in another script, though this outputs:
â[BridgeNet] waiting for (CreatePingStats) to be replicated to the clientâ)
Itâs likely because this script is running before the starter. Consider using BridgeNet.Started
if you are using 1.9.7+ versions.
Or just use single-script architecture.
I tried using BridgeNet.Started
, but the remote doesnât seem to fire. My script is in StarterGui, should I put it in StarterPlayerScripts?
Oh yeah, you should definitely do that because AFAIK you canât run local scripts within containers like StarterGui
.
Ok. I did it but the event has a 50 percent chance of firing, sometimes when I join the ping stat loads, other times it does not.
Local scipt that starts Bridge Net on the client:
local ReplicattedStorage = game:GetService("ReplicatedStorage")
local Storage = ReplicattedStorage:WaitForChild("Storage")
local Modules = Storage:WaitForChild("Modules")
local BridgeNet = require(Modules:WaitForChild("BridgeNet"))
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
Local script which fires the remote:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = ReplicatedStorage:WaitForChild("Storage")
local Modules = Storage:WaitForChild("Modules")
local BridgeNet = require(Modules:WaitForChild("BridgeNet"))
local CreatePingStats = BridgeNet.CreateBridge("CreatePingStats")
BridgeNet.Started:Connect(function()
CreatePingStats:Fire()
end)
Switch your script with this:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = ReplicatedStorage:WaitForChild("Storage")
local Modules = Storage:WaitForChild("Modules")
local BridgeNet = require(Modules:WaitForChild("BridgeNet"))
local CreatePingStats = BridgeNet.CreateBridge("CreatePingStats")
if BridgeNet.Started then
CreatePingStats:Fire()
else
BridgeNet.Started:Connect(function()
CreatePingStats:Fire()
end)
end
Great module, however, I could not find a way of invoking a client. Please let me know if there is a way!
Should I replace every RemoteEvent currently in my game with BridgeNet or is there still some cases where I need to use normal RemoteEvents?
You should be able to replace every RemoteEvent with BridgeNet- itâs more effective the more you use it, actually.