Proximity prompt to open gui doesn't function

this is a proximity prompt script that doesn’t set frames visible if possible please give me a clue
script:

prox = script.Parent
gui = game:GetService("StarterGui")
dialog = gui.Dialog
bg = dialog.Background
dbg = dialog.DialogFrame

prox.Triggered:Connect(function(triggerer)
		bg.Visible = true
		dbg.Visible = true
	end
end)
1 Like

You have an extra end, and you have to change the PlayerGui instead of the StarterGui.

Fixed code:

local prox = script.Parent

prox.Triggered:Connect(function(player)
	local playerGui = player.PlayerGui

	local dialog = playerGui.Dialog
	dialog.Background.Visible = true
	dialog.DialogFrame.Visible = true
end)
2 Likes

ye fixed it but still doesn’t work and lemme try the edit

2 Likes

and btw it’s “true” not “True” i have fixed it

1 Like

I’m on mobile so it probably auto-capitalized, sorry.

2 Likes

thank u so much my g i appreciate you

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.