How can I make ProximityPrompts show GUI?

I have no idea how to make it. I am not an expert in Proximity Function. I don’t want you to give away codes. Just to help me how to make it for my game. If you know anything helpful please comment. If a comment help solve my question, I will mark it as a solution post.

3 Likes
2 Likes

Been using proximity promityprompts alot for A current project, but basically i’ll offer two approaches here:

Server Sided Approach :
User triggers proximityprompt, use a remoteevent or whatever and fire it to the necessary client(s) and just have something in the onclientevent listener on the other side.

Client Sided Approach:
Again just listen for the trigger on the client and than do whatever you need to do from there.
I might’ve read too far into your question but yeah… And happy birthday @sjr04 :slight_smile:

2 Likes

Put this in a local script in StarterPlayer.StarterPlayerScripts

local ProximityPrompt = game.Workspace.PPPart.ProximityPrompt -- Replace with your prompt
ProximityPrompt.Triggered:Connect(function(Player)
	local Gui = script.GUI -- replace with your gui
	Gui:Clone().Parent = game.Players.LocalPlayer.PlayerGui
end)

And put your gui under it, like so.
image

1 Like

@Wrvel
Ah, sorry I misread!
First, it detects which player triggers it, then it checks if they have PlayerGui. Next, it checks if they have a UI with such name then changeds the enabled property.

local GuiName = "GUI_NAME_HERE"
ProximityPrompt.Trigger:Connect(function(Player)
  local PlayerGui = Player:WaitForChild("PlayerGui",10)
  if PlayerGui then
    local Gui = PlayerGui:WaitForChild(GuiName,10)
    if Gui then
      Gui.Enabled = not Gui.Enabled
    end
  end
end)

This should work perfect for your needs! Enjoy!

3 Likes

I am very apologetic of my inactivity I will check all the answers later. I will give a solution to someone. Just please do give me time! Thank you all for your help and support!

1 Like