Problem with opening voting system

  1. What do you want to achieve? Keep it simple and clear!
    So exactly i’m making map voting system and making GUI like in Arsenal,
  2. What is the issue? Include screenshots / videos if possible!
    I have special value which is true when voting in progress, for some reason when it’s true script stills spawn me on map instead of enabling voting GUI
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i was making voting system by video and all should be fine

Code:

local cc = workspace.CurrentCamera
local mc = workspace.MenuCamera
local Player = game.Players.LocalPlayer
local Slots = Player.PlayerGui.CustomHotBarGui.Slot
local Button = script.Parent
local GameGUI = script.Parent.Parent.Parent
local VotingGUI = script.Parent.Parent.Parent.Parent:WaitForChild("VotingGUI")
wait(1)
	Player.Character.HumanoidRootPart.CFrame = workspace.SpawnLoc.Floor.CFrame
wait(.001)

cc.CameraType = Enum.CameraType.Scriptable

cc.CFrame = mc.CFrame
for i,slots in ipairs(Slots:GetChildren()) do
	slots.Visible = false
end
local function playClicked()
	if game.ReplicatedStorage.Values.VotingProgress == true then
		VotingGUI.Enabled = true
		GameGUI.Enabled = false
	else
		cc.CameraType = Enum.CameraType.Custom
		Player.CameraMode = Enum.CameraMode.LockFirstPerson
		if workspace:FindFirstChild("Map") then
			Player.Character.HumanoidRootPart.CFrame = workspace.Map.Spawn.CFrame
			end
		for i,slots in ipairs(Slots:GetChildren()) do
		slots.Visible = true
		end
		GameGUI.Enabled = false
	end
end

Button.MouseButton1Click:Connect(playClicked)

I think you are missing .Value of the Bool Object

so it should be:

if game.ReplicatedStorage.Values.VotingProgress.Value == true then

Oh right didn’t saw it lemme try