Scripting Helpers is winding down operations and is now read-only. More info→
Log in to vote

ImageLabel not hiding when clicking a TextButton?

Asked by 1 year ago

I'm making a ghost hunting game, where you have a camera system. When I click the TV it works perfectly fine and opens up GUI but when I click Close button it just hides login frame and the button and not the camera overlay/cameras frame.

Server script (in ClickDetector):

event = game.ReplicatedStorage:WaitForChild("CloseCameras")

    player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.LoginMain.Visible = true
    player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.Close.Visible = true

function closeCameras(player)
    player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.LoginMain.Visible = false
    player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.Overlay.Visible = false
    player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.Close.Visible = false


LocalScript (in Close button):

event = game.ReplicatedStorage:WaitForChild("CloseCameras")
local player = game.Players.LocalPlayer
local character = player.Character
local camera = game.Workspace.CurrentCamera

    camera.CameraSubject = character.Humanoid
    camera.CameraType = "Custom"
    camera.CFrame = character.Head.CFrame
    script.Parent.Parent.LoginMain.LoginBackground.HiddenText.Text = ""

It seems to be working without any error in output, as I searched the script name in output (workspace.Van.TV.Screen.ClickDetector.Detect) it displayed nothing. Is there any way i can fix this? Is it normal that ImageLabels are not able to be hidden via script? I tried everything but it didn't work.

Any help would be great!

In the server script, I see that the Overlay gets toggled to false in the second function, but I don't see the Overlay getting toggled to true in the first function. Also, generally, any GUI scripts should be done locally, so I would just make one RemoteEvent with a true/false parameter for toggling on/off. Also, I'm a bit unclear on the question, could you send pictures of your problem? kodymarcey 49 — 1y
explorer view (i changed name of overlay): second image: GamerLighting23233 63 — 1y

Answer this question