So the idea is that when a player leaves the game a RemoveEvent is fired that sends to the server that players info before they left and change the GUI of that player to a disconnected image. However, it’s not working and I am unsure why.
userQueueConnectionType.OnServerEvent:Connect(function(player, arg)
if arg == "left" then
print(player.Name.. "left the game")
for _, v in pairs(players:GetPlayers()) do
local scrollingFrame = v:WaitForChild("PlayerGui"):WaitForChild("WaitForPlayers"):WaitForChild("Queue"):WaitForChild("playersLoadedFrame"):WaitForChild("ScrollingFrame")
for _, child in pairs(scrollingFrame:GetChildren()) do
if child.Name == player.Name then
print("isthisworking")
child.disconnectedIcon.Visible = true
end
end
end
end
end)
If a player disconnects, their client will stop sending messages to the server, so this will not work.
game.Players.PlayerRemoving:Connect(function(player)
print(player.Name.. "left the game")
for _, v in pairs(players:GetPlayers()) do
local scrollingFrame = v:WaitForChild("PlayerGui"):WaitForChild("WaitForPlayers"):WaitForChild("Queue"):WaitForChild("playersLoadedFrame"):WaitForChild("ScrollingFrame")
for _, child in pairs(scrollingFrame:GetChildren()) do
if child.Name == player.Name then
print("isthisworking")
child.disconnectedIcon.Visible = true
end
end
end
end)
I would also not recommend changing player GUI’s on the server, instead you should use remote events to do that for you.
local player = game.Players.LocalPlayer
game.ReplicatedStorage.PlayerLeftEvent.OnClientEvent:Connect(function(plr)
player.PlayerGui.WaitForPlayers.Queue.playersLoadedFrame.ScrollingFrame:FindFirstChild(plr).disconnectedIcon.Visible = true
end)
I promise you sending 1 remote thats likely bytes in size doesn’t affect anything, and also none of us have a reason to care about bandwidth, thats roblox’s problem, not ours
Right, but I specified 1 remote, saying ‘it adds up really fast’ implies that you’re sending multiple events. And for the GUI to be changed by the server, and show up on the client is 100% the same as sending a remote event. Also, I literally do not care what Raknet is, i’m not a web developer like you, I have no reason to be educated on roblox’s networking.
Now you’re just yapping, what are you arguing atp? Also, im not a web developer, but I know the amount of information varies between remotes, so no, they do not send the same amount of packets.
professionals care ALOT about the bandwidth usage, and not using events that don’t need to be used.
To say its roblox’s problem is idiotic, you as a developer get given recourses (and usually quite good server recourses), its up to you to manage them correctly. “thats roblox’s problem, not ours”
Networking is very important, If things are used incorrectly, can slow down your game (ex: server managing stuff that the client should handle)
Inefficient systems and tasks can add up overtime leading to more issues.
Optimizations are VERY Important, and you are uneducated if you dont think so, they are very important in games, and will make your life easier, as well as a more fun experience.
Multiple Remotes are more efficient than a Singular Remote when sending specific Data
And I would most certainly reccomend you learn how respect others, and not cause arguments because you do not agree with others, it will get you nowhere, just a bad reputation.
Spelling does not matter here, only the correct, and most recent information, we debate, and try to help others, not trash talk, and argue with others.