UI is not updating for all the Clients. RemoteEvents issue..?

Well, you can try it. It’s a server script after all and there are no remote events. Here’s what I did and it worked!

local RS = game:GetService("ReplicatedStorage")
local UI_tag = RS:FindFirstChild("UI")
local VotingTime = RS:FindFirstChild("VotingTime")

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		UI_tag:Clone().Parent = character.Head
		player.PlayerGui.UI.Adornee = character.Head
		
		VotingTime.Changed:Connect(function()
			if VotingTime.Value == true then
				for _, v in ipairs(game.Players:GetChildren()) do
					if v:IsA("Player") and v ~= nil then
						local playerGui = v.PlayerGui
						playerGui.UI.Main.Visible = true -- Reference your UI.
					end
				end
			else
				for _, v in ipairs(game.Players:GetChildren()) do
					if v:IsA("Player") and v ~= nil then
						local playerGui = v.PlayerGui
						playerGui.UI.Main.Visible = false -- Reference your UI.
					end
				end
			end
		end)
	end)
end)

You can try to change your code to this:

local RS = game:GetService("ReplicatedStorage")
local UI = RS:FindFirstChild("UI")
local VotingTime = RS:FindFirstChild("VotingTime")


game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		UI:Clone().Parent = player.PlayerGui
		player.PlayerGui.UI.Adornee = character.Head
		
		while wait() do
			if VotingTime.Value == true then
				for _, v in ipairs(game.Players:GetChildren()) do
					if v:IsA("Player") and v ~= nil then
						local playerGui = v.PlayerGui
						playerGui.UI.Main.Visible = true -- Reference your UI.
					end
				end
			else
				for _, v in ipairs(game.Players:GetChildren()) do
					if v:IsA("Player") and v ~= nil then
						local playerGui = v.PlayerGui
						playerGui.UI.Main.Visible = false -- Reference your UI.
					end
				end
			end
		end
	end)
end)

Sorry, I meant this was the code I used

local RS = game:GetService("ReplicatedStorage")
local UI_tag = RS:FindFirstChild("UI")
local VotingTime = RS:FindFirstChild("VotingTime")

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		UI_tag:Clone().Parent = character.Head
		character.Head.UI.Adornee = character.Head
		
		VotingTime.Changed:Connect(function()
			if VotingTime.Value == true then
				for _, v in ipairs(game.Players:GetChildren()) do
					if v:IsA("Player") and v ~= nil then
						local playerGui = v.Character.Head.UI
						playerGui.Main.Visible = true -- Reference your UI.
					end
				end
			else
				for _, v in ipairs(game.Players:GetChildren()) do
					if v:IsA("Player") and v ~= nil then
						local playerGui = v.Character.Head.UI
						playerGui.Main.Visible = false -- Reference your UI.
					end
				end
			end
		end)
	end)
end)

While this is the only solution so far, I’m still a bit hesitant to use this code due to an ongoing bug.

I’m trying to steer away from placing things inside the character (because I did it a lot).

EDIT: But if this is the only way to do what I’m trying to do, then so be it I guess :confused:

i mean what’re they gonna do? not see the voting script?

I don’t want exploiters being able to view anybody’s BillboardGui through the character because later on I’m going to be relying on them as a voting system with a little number off to the side.

Furthermore, if the bug stated above is true, I don’t want an exploiter deleting their BillboardGui, ultimately giving them the benefit of not allowing players to see their suspicion meter.

EDIT: Ultimately I’ve settled on putting the BillboardGui inside the Head of the player. I’ll just have to come up with ways on how I can counter this if the Client somehow deletes the UI.

1 Like