[SOLVED] ProximityPrompt doesn't work at the first time, but yes the second

  1. What do you want to achieve?
    A ProximityPrompt is located in a part. When triggered, it uses the “playerWhoTriggered” value to enable a GUI in the player’s PlayerGui.

  2. What is the issue? Include screenshots / videos if possible!
    The problem is that when I click it the first time, it doesn’t do anything, but the second time it works. Here is a video and the code:

local prompt = script.Parent.ProximityPrompt

prompt.Triggered:Connect(function(playerWhoTriggered)
	playerWhoTriggered.PlayerGui.FridgeUI.Enabled = not playerWhoTriggered.PlayerGui.FridgeUI.Enabled
end)
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I couldn’t find any solution online. It seems like no one is having the same problem.

Only thing I can think of is that your fridgeUI is already enabled. Try fiddling with the properties.
If that doesn’t work, try linking it with a localscript through a remote event.

Yep, the UI was enabled when you join. Making it false made it work.

1 Like