Help With ProximityPrompt

I am trying to make a script to when a player clicks e UI will come up. When I hit e nothing happens, no errors, or UI comes up

How do I fix this

local ProximityPromptA = script.Parent.ProximityPrompt
local UI = game.StarterGui.CrateUI.Frame

local player = game.Players.LocalPlayer

ProximityPromptA.Triggered:Connect(function()
	UI.Visible = true
end)

Your UI is parented to StarterGui. Since StarterGui automatically clones to PlayerGui, this code won’t work.

Instead try:

local ProximityPromptA = script.Parent.ProximityPrompt
local player = game.Players.LocalPlayer
local UI = player.PlayerGui:WaitForChild("CrateUI").Frame

ProximityPromptA.Triggered:Connect(function()
	UI.Visible = true
end)

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