I want to make if you click on the part with image that in workspace, you can see this image from gui, and if you click on this gui - it dissapears. It works only one time and then doesn’t. Here it is:
This is the script for workspace image:
script.Parent.ClickDetector.MouseClick:Connect(function(Player)
local imageInGui = Player.PlayerGui.ScreenGui.Image
imageInGui.Visible = true
end)
Apparently it’s a different UI element being toggled invisible, maybe one of its ancestors. Maybe check which UI is being toggled by going through the Explorer?
I recommend checking the ‘hierarchy’ if i spelled it wrong sorry, for the gui and scripts, it might toggle the wrong elements, and your error that you provided has nothing to do with the issues you’re experiencing, i’ve seen it many times too, and my only guess is that it is a roblox background process error.
When you set the image’s ‘Visible’ property to ‘false’ on the client the server still sees it as ‘true’. You need to set the image’s ‘Visible’ property either on the server only or on the client only. This can be achieved via a ‘RemoteEvent’ instance.
Oh, i was need just to change the Image to the ImageButton, change LocalScript to script and everything works (because i don’t need to detect mouse with ImageButton)