Module Script Doesn't read value

I store a bool value under the player called Finished and the value is left false. However the module script still adds the player to the winners table.

local module = {}
Minigame = script.Parent.Parent
module.Winners = {}

function module:IsContestants(player)
	for i,v in pairs(Minigame.MinigameInfo.Contestants:GetChildren()) do
		if v.Value == player and Minigame.MinigameInfo.TempContestants:FindFirstChild(player.Name) then
			return true
		end
	end
	return false
end

function module:IsWinner(player)
	for i,v in pairs(module.Winners) do	
		if v == player then
			return v
		end
	end
end 

function module:AddWinner(player)
	if module:IsContestants(player) and not module:IsWinner(player) then
		if game.Players[player].Finished.Value == false then 
			return		
		else
			table.insert(module.Winners, player)
			local child = Minigame.MinigameInfo.TempContestants:FindFirstChild(player.Name)
			if child then
				child:Destroy()
			end
		end
	end
end

return module

Print this value (& tell me the results), make sure you change the value server-sidedly.

nvm i fixed it thx for the reply

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.