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:
- Using a debounce to see if it was broken from triggering too many times.
- Changing the properties of the Proximity Prompt.
- I have looked at other posts and none have worked so far for me.
Extra info:
- I have gotten no errors in the output tab.
- 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!