Proximity Prompt does not work after triggering it for a couple of times

For the context: (There are multiple of lockers with the same script)

This is a script where a player trigger the proximity prompt to get inside the locker and then a button (gui) would pop up for the player to click to leave the locker. When I just trigger the same locker proximity prompt multiple times, it would work just fine. But once I trigger another locker’s proximity prompt (The duplicate of the previous one) it starts to stop working, by not working I mean after I done holding E ( Activating it ) nothing happen . Literally the “Triggered” text is not even being printed. Can somebody help me figure out what the problem is please :sob:

image

your issue isn’t Roblox randomly breaking, it’s that you’ve got a separate listener and a single shared check flag in each locker script all hooked up to the same RemoteEvent,
when you fire it from Locker A, Locker B’s listener also runs and flips its flag,
so your next fire from Locker B quietly does nothing.
Make one centralised serverside RemoteEvent listener instead of per locker listeners with a shared flag and have each prompt fire the event passing its locker instance so the single handler only moves that specific player in or out.

The post above solved this issue (Probably) but I have another tip for you. There’s a service called ProximityPromptService, which you can use in one script to manage all the lockers, instead of having an individual script for each of them. Then if you have to make any changes, you don’t have to go through several scripts to fix them all.

Sorry but how can I make it a centralised serverside RemoteEvent listener

Just place one Script in ServerScriptService that connects once to your RemoteEvent,
that single listener handles every locker, using the passed in locker instance so it always acts on the correct one