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") script.Parent.MouseClick:Connect(function(player) player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.LoginMain.Visible = true player.PlayerGui:WaitForChild("SecurityCameras").Mainframe.Close.Visible = true end) 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 end event.OnServerEvent:Connect(closeCameras)
LocalScript (in Close button):
event = game.ReplicatedStorage:WaitForChild("CloseCameras") local player = game.Players.LocalPlayer local character = player.Character local camera = game.Workspace.CurrentCamera script.Parent.MouseButton1Click:Connect(function() event:FireServer(player) camera.CameraSubject = character.Humanoid camera.CameraType = "Custom" camera.CFrame = character.Head.CFrame script.Parent.Parent.LoginMain.LoginBackground.HiddenText.Text = "" end)
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!