Script is not opening GUI

My local script is

local proxminityPrompt = script.Parent

proxminityPrompt.Triggered:Connect(function()
	game.StarterGui.ScreenGui.ImageLabel.Visible = true
end)

I cannot seem to change the visibility of the UI ingame whether changing it in Explorer or in a script, I’m unsure if this is a bug or something wrong with my script. I cannot do in a completely fresh game either

1 Like

Try this

local proximityPrompt = script.Parent

proximityPrompt.Triggered:Connect(function(player)
	local playerGui = player:WaitForChild("PlayerGui")
	local screenGui = playerGui:FindFirstChild("ScreenGui")

	if screenGui then
		local imageLabel = screenGui:FindFirstChild("ImageLabel")
		if imageLabel then
			imageLabel.Visible = true
		end
	end
end)
1 Like

Same issue the UI doesn’t show, can you test if that works for you or my studios just bugged

1 Like

Right yk when u click visible on the ui does it show like if ur not ingame like send me a screenshot ofui and properties

Also check if ur screengui is enabled

in game


Not In Game

and i have checked that it is enabled

Use remote events. When you click a button that has a server-side script, the local script is executed. (I’m using a translator)

It’s already a Local script. Also the problem is that I cannot change the visibility when play testing.

I can show you my version later. I’m writing on my phone right now.

You can’t use local scripts in the workspace,
Instead have a script on the server and send a signal via remotes to the client/ player:

First create a remote event under replicatedstorage and call it proximityRemote

Server Script under the part:

local replicatedStorage = game:GetService("ReplicatedStorage")

local part = script.Parent
local proximityPrompt = part:FindFirstChildOfClass("ProximityPrompt")

local remote = replicatedStorage:WaitForChild("proximityRemote")

proximityPrompt.Triggered:Connect(function(player)
remote:FireClient(player)
end

Local script

local replicatedStorage = game:GetService("ReplicatedStorage")

local gui = script.Parent

local remote = replicatedStorage:WaitForChild("proximityRemote")

remote.OnClientEvent:Connect(function()
gui.Enabled = not gui.Enabled
end)

Thank you, but this is not the core issue I cannot seem to change the visibility state of any GUI whether script or not. I have eliminated all external factors and it still happens even in completely new games

istead of a local script use a script

Also when changed manually?


Yes Including when changed manually using the properties tab

Have you tried disabling the entire screenGui, does that work?
Otherwise providing the place file could be very helpfull for us.

try make it script instead of local script that should fix the issue

Are you blind? He/ She literally told you thats not the issue above:

i meant using the script i provided earlier

I realised I had some bugs in the script, changing the visibility in the properties does not work, so that made me think that this script wasn’t working. Still a bug if the state of a GUI cannot be changed in the properties tab. But the script does work (thank you @jellolemo for the working scripts btw)

Could you send the place file please