LocalScript is showing everyone the gui

Hello, I am using a LocalScript because I am changing the players gui. When I change the players gui from disabled to enabled, it shows it to everyone. Any solution?
–The parent of the script is StarterPlayerScripts!
game.Workspace.TimerStart.Touched:Connect(function(player)
local Debounce = false
if not Debounce then
Debounce = true
game.Workspace.TimerStart.CanCollide = false
game.Players.LocalPlayer.PlayerGui.TimerGui.TextLabel.LocalScript.Disabled = false
game.Players.LocalPlayer.PlayerGui.TimerGui.Enabled = true
game.Players.LocalPlayer.PlayerGui.TimerGui.TextLabel.LocalScript.Disabled = false
wait(3.5)
game.Workspace.TimerStart.CanCollide = true
wait(10.0)
Debounce = false
end
end)
game.Workspace.TimerStop.Touched:Connect(function()
local Debounce = false
if not Debounce then
Debounce = true
game.Players.LocalPlayer.PlayerGui.TimerGui.TextLabel.LocalScript.Disabled = true

	wait(10.0)
	
	
	
	Debounce = false
end

end)

It’s probably because you’re trying to change the gui’s enabled property from the replicated gui on the player’s client. To fix, put the local script in the screenGui(TimerGui) and instead of saying game.Players.LocalPlayer.PlayerGui.TimeGui say, script.Parent.TextLabel.LocalScript.Disable = true

Hope this helps! :smiley:

3 Likes

Oh my, thanks so much! That was such a simple mistake I made. Thanks!

Wow, this means so much to me! Anytime! :grin:

1 Like