Proximity Prompt not activating more than once

What I am trying to do:
Hello fellow Roblox designers! In the game I am making, I want to be able to walk up to a shop and enable a Gui using a Proximity Prompt. I am trying to make it to where said Proximity Prompt can be activated as many times as the player wants to open the shop.

The problem:
The problem I have is that the Proximity Prompt is not triggering again after using it the first time. I am using a Local Script and Remote Events to do this and the code inside them will be posted below.

This is the code I have been using in the Proximity Prompt’s Local Script:

script.Parent.Triggered:Connect(function(player)
	game.ReplicatedStorage.ShopEvents.OpenShopEvent:FireServer()
	wait(.5)
end)

And this is the code I have been using for the Remote Event:

local RS = game.ReplicatedStorage
local ShopEventFolder = Instance.new("Folder", RS)
ShopEventFolder.Name = "ShopEvents"
--------------------------
local OpenShop = Instance.new("RemoteEvent", RS)
OpenShop.Name = "OpenShopEvent"
OpenShop.Parent = ShopEventFolder

OpenShop.OnServerEvent:Connect(function(player)
	player.PlayerGui.ShopGui.Enabled = true
end)

Also, here are the Proximity Prompt properties:

Solutions I have tried:

  1. Using a debounce to see if it was broken from triggering too many times.
  2. Changing the properties of the Proximity Prompt.
  3. I have looked at other posts and none have worked so far for me.

Extra info:

  1. I have gotten no errors in the output tab.
  2. The problem is most likely not in the Gui related to the shop.

If anybody has faced this problem and/or knows the solution, it would be of great help to me if you could share it here. Thanks for reading!

Are you then closing the ShopGui from client code? If so, the server still sees it as enabled, thus any subsequent attempts for the server to re-set it to enabled do nothing…since it already thinks it’s enabled. Thus, that wouldn’t replicate over to the player.

To that point, why are you having the server open the ShopGui? All UI stuff should be 100% driven by client-side code. Just have the client open up the ShopGui itself when triggered.

I am embarrassed to say that was absolutely the solution lol. Thank you for helping me, I would have never thought of that!

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