I have a vote script for my project but when I try to look for the buttion when the updated vote the buttion comes up nil
for _, updatedPlayer in pairs(game.Players:GetPlayers()) do
local playerGui = updatedPlayer:FindFirstChild("PlayerGui")
if playerGui then
local button = updatedPlayer.PlayerGui.UI.SelectGamemode:FindFirstChild(tostring(option))
if button and button:FindFirstChild("Count") then
-- Ensure Count exists
local countText = button.Count
countText.Text = tostring(tonumber(countText.Text) + 1) -- Update Count
else
warn('Count not found for option:', option)
end
end
end
Extra Info: The buttion is the Number of which the buttion is like 1 to 3, yes the script can find the playergui