#im working on making this gui open when a proximity prompt is pressed can someone please help

1 messages · Page 1 of 1 (latest)

brittle cloud
#

The prompt is in a part in workspace called PromptPart and it has a proximty prompt inside i tryed to script it myself and chat gpt tryed but nothing worked.

primal knot
#

just put a script in the part and do

local part = script.Parent
local prompt = part.ProximityPrompt

prompt.Triggered:Connect(function(player)
  local gui = player.PlayerGui:FindFirstChild("Gear")
  if not gui then return end

  gui.Enabled = not gui.Enabled
end)
brittle cloud
#

tysm il give it a go

primal knot
#

It would technically be better to put a local script in the gui itself that defines the part and does the same as above, but I'm too lazy to explain that

brittle cloud
#

wait so i just use a normal script?

primal knot
#

You can, yeah

#

If you're doing the method of putting in the part

#

Might want to make it so the run context of the script is on the client, though

#

Won't matter in most cases but might as well

brittle cloud
#

when i interact with the prompt nothing happens

primal knot
#

Wait a sec, I'll check if I did something wrong rq

waxen blazeBOT
#

studio** You are now Level 12! **studio

brittle cloud
#

i do have to go to school in a few min so i can show you more after

primal knot
#

Do you have the screen gui itself disabled to make it so the gui doesn't show up, or are you making the stuff in it to not be visible

brittle cloud
#

just not visable

primal knot
#

This method just enables and disables the screen gui itself, you'll have to personalize it a bit if you want it to switch the visibility of individual frames and stuff

brittle cloud
#

oh yeah we can just disable it

#

oh it works tysm