So I am just doing a simple thing, making GUIs invisible when you click on a certain button. For some reason, the buttons are going invisible but you can't script it to become visible again. This might be because I have used the roundify plugin on the text buttons but I am not sure. This is my code.
ClickDetector1.MouseClick:Connect(function() script.Parent.Parent.Stats.TextButton.Visible = false script.Parent.Parent.Storage.TextButton.Visible = false script.Parent.Parent.ScreenGui.TextLabel.Visible = false end) No.MouseButton1Click:Connect(function() script.Parent.Parent.Stats.TextButton.Visible = true script.Parent.Parent.Storage.TextButton.Visible = true script.Parent.Parent.ScreenGui.TextLabel.Visible = true end) Close.MouseButton1Click:Connect(function() script.Parent.Parent.Stats.TextButton.Visible = true script.Parent.Parent.Storage.TextButton.Visible = true script.Parent.Parent.ScreenGui.TextLabel.Visible = true end) Yes.MouseButton1Click:Connect(function() wait(10) script.Parent.Parent.ScreenGui.TextLabel.Visible = false end) Shop.MouseButton1Click:Connect(function() script.Parent.Parent.ScreenGui.TextLabel.Visble = false script.Parent.Parent.ScreenGui.TextLabel.Position = UDim2.new(0.386, 0,0.057, 0) end)
Please be aware that where the visible check is in the properties tab, it is ticking on and off when I want it to, but it is not physically becoming visible, even if the visible property in the properties tab is ticked on. Thank you if you can help!
You need to use a LocalScript when you want the client can interact with a UI. So change up the Script (ServerScript) to a LocalScript (ClientScript) that you putting in your ScreenGui.
I recommand found the ScreenGui with the PlayerService (Players) and not with the Parent of the Instance.
local PlayerService = game:GetService('Players') -- You can see this Folder in the explorer. local Player = PlayerService.LocalPlayer -- LocalScript only, this is you. local PlayerGui = Player:WaitForChild('PlayerGui') -- Here is your ScreenGui local ScreenGui = PlayerGui:WaitForChild('ScreenGui') -- Change "ScreenGui" to the name of yours
Use WaitForChild to prevent errors.
Now to fix your ClickDetector, use a Script (ServerScript). When a Client click on a ClickDetector a argument is sent and this argument is the client.
ClickDetector1.MouseClick:Connect(function(Player) local PlayerGui = Player:WaitForChild('PlayerGui') local ScreenGui = PlayerGui:WaitForChild('ScreenGui') -- Change "ScreenGui" to the name of yours ScreenGui.Stats.TextButton.Visible = false ScreenGui.Storage.TextButton.Visible = false ScreenGui.ScreenGui.TextLabel.Visible = false end)
Hope this help, to more questions put bellow on commentaries.
This script doesn't work because you don't define what ClickDetector1, No, Close, and Shop are.