Skip to content

Commit

Permalink
Update AnomalyDetector.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
AqwamCreates authored Oct 14, 2023
1 parent 78b15f5 commit 6c21bae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DistributedComputing/AnomalyDetector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ end

function AnomalyDetector:onPredictedValueReceived(WatchingPlayer: Player, WatchedPlayer: Player, predictedValue)

if (WatchedPlayer == WatchingPlayer) and (#Players:GetPlayers() > 1) and self.OnClientAccessedFunction then self.OnClientAccessedFunction(WatchingPlayer, WatchedPlayer, predictedValue) return end
local numberOfPlayersInServer = #Players:GetPlayers()

if (WatchedPlayer == WatchingPlayer) and (numberOfPlayersInServer > 1) and self.OnClientAccessedFunction then self.OnClientAccessedFunction(WatchingPlayer, WatchedPlayer, predictedValue) return end

local watchingPlayerStringUserId = tostring(WatchingPlayer.UserId)

Expand All @@ -175,7 +177,7 @@ function AnomalyDetector:onPredictedValueReceived(WatchingPlayer: Player, Watche

for watchedByPlayerStringUserId, otherPredictedValue in watchedPlayerReceivedPredictedValues do

if (watchedByPlayerStringUserId == watchingPlayerStringUserId) and (#Players:GetPlayers() > 1) then continue end
if (watchedByPlayerStringUserId == watchingPlayerStringUserId) and (numberOfPlayersInServer > 1) then continue end

local PlayerToSet: Player = Players:GetPlayerByUserId(tonumber(watchedByPlayerStringUserId))

Expand Down

0 comments on commit 6c21bae

Please sign in to comment.