Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ProximityPrompt not working. Do they not work with GUIs? [ANSWERED]

Asked by 3 years ago
Edited 3 years ago

Hello, first of all i would like to thank to spend your valuable time to answer my question.

I am working on a game and i wanted to open up a GUI using proximityPrompts. I am a BIG NOOB so dont judge me if this is a silly question.Anyways,

ButtonHolder is a part in workspace containing a ProximityPrompt which is the parent of my LocalScript.RolesGUI is a ScreenGUI which contains a Frame called RolesUI. I want the frame to appear when I trigger the ProximityPrompt

local Button = game.Workspace.ButtonHolder.ProximityPrompt
local PromptService = game.GetService("ProximityPromptService")

script.Parent.Triggered:Connect(function()
    print("yes")
    local RolesUI = game.StarterGui.RolesGUI.RolesUI
    RolesUI.Active = not RolesUI.Active
    RolesUI.Visible = not RolesUI.Visible
end)

Thanks for spending your valuable time! I really appreciate it.

0
the print statement doesnt even show up. HELPPPP BharatAir 0 — 3y
0
if that is from a local script, it wont run because its in workspace. instead, put it in starter player scripts and do button.triggered instead of script.parent.triggered. i don't know if proximity prompt works locally. if it doesnt work you can use a remote instead. also when changing ui do in player gui instead of starter gui. BulletproofVast 1033 — 3y
0
ummm sorry for late response but thanks a lot to u BharatAir 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

So I happened to figure ta solution out myself. Posting this for any person in future facing similar issues. I just substituted the Frame.Active for ScreenGui.Enabled and it happened to work.

Just a simple way around, hope it helps.

Ad

Answer this question