Does anyone know why this is happening?

I want to make 2 “npcs” that pop up different gui, and they both have different proximity prompts.
Screenshot 2024-07-04 121807
Screenshot 2024-07-04 121811
these are the 2 npcs, one of them pop up different gui
my problem is that when i trigger the proximity prompt, it pops up both of the gui instead of one of them
this is the script





These are the scripts, the first one is a server script in the yellow hair npc proximity prompt, the second one is a server script, inside of the pink hair npc proximity prompt, the third one is the client script for the first server script which is supposed to open the first background, and the fourth one is a client script for the second server script which is supposed to open the background2 below
Screenshot 2024-07-04 121723
Screenshot 2024-07-04 121731
i want to open bacground1 for the yellow hair npc and i want to open backgound2 for the pink hair npc, but each time i trigger either of the npc proximity parts both of the background gui open, when i dont want that to happen. this my explanation may not be very good so please correct me if i need to explain more but how can i fix this problem?

my mistake, i meant to say the third picure is for the second client script and the fourth client script is for the first servers script

When you use ProximityPromptService, it probably fires every time any ProximityPrompt is triggered. Try using the NPC’s ProximityPrompt for the event instead of using the service.

2 Likes

it gave me this error when i used this script


When using ProximityPrompt.Triggered, the only argument is the player who triggered it. You need to change the onPromptTriggered function to only take the player argument and remove the promptObject argument.

Thank you for giving me my solution, the gui pop up now works for both npcs now that i removed the prompt object in the script

1 Like

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