So what if a client script Listens to server events? and the client script gets destroyed? Does that mean it creates memory leaks? since it stopped listening?
I’m not sure how Clock is supposed to work. I understand the initiative behind it, but this code doesn’t work.
local Red = require(game:GetService("ReplicatedStorage").Red)
local Clock = Red.Clock
local NewClock = Clock.new(1, function()
print("new clock 1")
end)
local NewClock2 = Clock.new(1, function()
print("new clock 2")
end)
NewClock2:Pause()
task.wait(5)
NewClock:Pause() -- prints "new clock 1" 5 times + it works only upto here
NewClock2:Resume()
You cannot resume a second clock, what’s the issue here?
Can you tell us how newbies of learning Roblox’s networking system should understand the benchmarking? It doesn’t help that only a few white and interactable buttons on the screen could make them understand how it works.
Can you also share us where to know and understand more of Roblox’s networking system?
Overall I think this module is pretty handy if you want to ensure your game is smooth in terms of network.
I am not sure if I am doing something wrong but correct me if I am. But when I fire from the Client > Server It works fine, but if I fire from Server > Client I keep getting a warning That I need to Register the EventName on the Server first? I even tried Setting NameSpace the same and Sending the Event yet nothing happens.
Here is the current code that I am using to fire from the server to All Clients, But when ran is something along the lines of “[Red.Serdes]: Retrieving identifier exceeded 5 seconds. Make sure ‘TestName_TestName’ is registered on the server.”
--// Client
local Red = require(game.ReplicatedStorage:WaitForChild("Red"))
local Net = Red.Client("TestName")
Net:On("TestName", function()
print("Hello from server!")
end)
--// Server
local Red = require(game.ReplicatedStorage:WaitForChild("Red"))
local Net = Red.Server("TestName")
Net:FireAll("TestName")
Client means player, you have to fire to every client that joins the game to register it on that client and prevent that error
local Net = Red.Server("TestName")
local function onPlayerAdded(player)
Net:Fire(player, "TestName")
end
Players.PlayerAdded:Connect(onPlayerAdded)
for i,player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end