Gui only showing up on one player when there should be all players seeing the gui

I want to make my script make all players see the gui when the value in one of script in server changes. The problem is that only one player’s gui enables when there should be all players seeing the gui.

this script is inside of the gui and Script.Parent is gui that I want to make it appear on all players when value on ReplicatedStorage called HiddenStatus changes.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game:GetService("Players").LocalPlayer
local HiddenStatus = game.ReplicatedStorage.HiddenStatus

local voteOne = script.Parent.ImageLabel.likeOne
local voteTwo = script.Parent.ImageLabel.likeTwo
local voteThree = script.Parent.ImageLabel.likeThree
local voteFour = script.Parent.ImageLabel.likeFour
local voteFive = script.Parent.ImageLabel.likeFive

local Vote = ReplicatedStorage.Sfx.Vote
local CurrentVote = 3

local Gui = script.Parent.ImageLabel

HiddenStatus:GetPropertyChangedSignal("Value"):Connect(function()
	if HiddenStatus.Value == "Vote" then
		script.Parent.Enabled = true
		Gui.Position = UDim2.new(0.279, 0,1, 0)
		
		wait(0.5)
		
		Gui:TweenPosition(UDim2.new(0.278, 0, 0.754, 0), "Out", "Quint", 1, false)
		
	elseif HiddenStatus.Value == "EndVote" then
		Gui:TweenPosition(UDim2.new(0.279, 0,1, 0), "Out", "Quint", 1, false)
		wait(1)
		script.Parent.Enabled = false
		ReplicatedStorage.Remote.VoteEnd:InvokeServer(CurrentVote)
	else
		script.Parent.Enabled = false
	end
end)

Why is this only working for one player in game?

You should probably instead fire a remote to the server and with a serverscript connecting that remote and having that remote function enable all the UI’s, for ex: create a variable in the serverscript, local players = game.Players:GetPlayers()

then when that remote has been fired we’ll say inside that remote function,

players.PlayerGui:WaitForChild(“UINameHere”).Enabled = true

Perhaps that should work? Reply if it does

2 Likes

Wow didn’t even thought of that! Now all players can see the gui by firing remote, thanks.

Np man, remotes are very useful in somewhat on that category, you should definitely use them more often but be careful because not securing your remotes can result in exploiters tampering with them.

1 Like