I have a point system in my game and at the end of a round, it is supposed to fireallclients, but it is failing to do so, i’ve never had this bug before and it randomly popped up out of no where
Here are some things I have tried:
Rewriting the entire point system
Using other scripts to fire the event
Here are my scripts:
Server:
local SharedPointsTable = require(ServerStorage.Modules.RoundModules.Tables.UniversalPointsTable) -- // Although it's only used in this script; I have had ideas in the past that I might incorporate in future updates that requires other scripts, So i'm just planning ahead of time.
AddPointEvent.Event:Connect(function(Player : Player, AmountOfPoints : number)
if Player then
SharedPointsTable[Player.Name] = (SharedPointsTable[Player.Name] or 0) + AmountOfPoints
UpdatePlayerGUI:FireClient(Player, SharedPointsTable)
print(SharedPointsTable)
end
end)
EndRoundGUI.OnServerEvent:Connect(function()
if SharedPointsTable ~= {} then
print(SharedPointsTable)
EndRoundGUI:FireAllClients(SharedPointsTable)
table.clear(SharedPointsTable); SharedPointsTable = {}
print("Successfully Ended!")
end
end)
Client:
local UIEvents = EventsFolder:WaitForChild("UI_Events")
UIEvents.LeaderboardRoundEnd.OnClientEvent:Connect(function(SharedPointsTable)
if SharedPointsTable then
print("Continue!")
end
end)
Thank you