1. Objective
The primary objective is to ensure that the AFK/queue system functions seamlessly, allowing players to be added or removed from the queue as necessary for the proper operation of the game.
2. Issue Description
The AFK/queue system in our game is currently experiencing disruptions that lead to game-breaking situations. Specifically, when a round ends or a player goes AFK, the system encounters errors. (however, errors don’t show up in the output) It’s important to note that the error appears to be related to the provided script, as the system functions correctly without its inclusion. Notably, the function RWMG.PlayerCheck()
is pivotal for initiating the game.
3. Evidence
Unfortunately, I encountered difficulties when attempting to upload a 23-second MP4 video demonstrating the issue. While I’m unable to provide the video at this time, I’ve attached a screenshot that showcases the error.
4. Troubleshooting Steps Taken
Over the course of nearly two days, I have actively worked to address this issue with the assistance of ChatGPT. Although some progress has been made, a solution has not yet been identified. In addition to utilizing ChatGPT, I have scoured both the Roblox Developer Hub and various online forums in an attempt to resolve this issue, but unfortunately, no viable solution has been found thus far.
5. Code Snippet
Here is the relevant code snippet where the issue seems to originate:
function RWMG.MakeQueue()
for _, player in pairs(Playerr:GetPlayers()) do -- playerr represents the player variable
local playerName = player.Name
local playerGui = player:FindFirstChild("PlayerGui")
local isAFK = playerGui and playerGui:FindFirstChild("AFK") and playerGui.AFK.AFKValue
if isAFK.Value == false then
table.insert(InGameTable, playerName)
print(playerName .. " is not AFK")
else
table.remove(InGameTable, playerName)
print(playerName .. " has gone AFK")
end
end
repeat wait() until #InGameTable >= 2
if #InGameTable >= 2 then
RWMG.PlayerCheck(InGameTable) -- start game
else
print("not ready")
end
end
6. Request for Assistance
Given the critical nature of the AFK/queue system to our game’s functionality, I am seeking the expertise of the Roblox community to help identify and rectify the underlying issue. Any guidance, insights, or solutions that can be provided to resolve this problem would be greatly appreciated.
Thank you for your support!