-
What do you want to achieve? Keep it simple and clear!
A proximity prompt that make a gui visible
-
What is the issue? Include screenshots / videos if possible!
It keeps giving me errors for line 4 of my script, it looks fine to me.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
local UI = script.Parent.MainFrame
local DB = false
local CloseB = UI.Close.CloseButton
local proximity = game.Workspace.FridgeUiTrigger.ProximityPrompt
proximity.Triggered:Connect(function()
print("test1")
if not DB then
print("test2")
DB = true
UI.Visible = true
end
end)
CloseB.MouseButton1Click:Connect(function()
print("test3")
if DB then
print("test4")
UI.Visible = false
DB = false
end
end)
2 Likes
have you spelled it correctly? have you capitalized everything correctly? are you sure itâs there?
1 Like
What error do you get and is it in a localscript? ProxyPrompts donât work in localscripts
1 Like
Script âPlayers.deathwish128000.PlayerGui.FridgeGui.LocalScriptâ, Line 4 - Studio - LocalScript:4
10:33:15.021 Stack End - Studio
1 Like
Could you proride a screenshot of the whole console after this error is printed out, while playtesting?
What do you mean they dont work in a local script?
1 Like
Thatâs just the script pointer. The error should be red text above that. Can you send that?
Input is not detected from a ProximityPrompt in a localscript. It wonât return errors, the script just wonât pick up on any events fired by a ProximityPrompt
make the output window bigger and screenshot the 2 lines above it.
Expand the Output console and share the text above that text. Thanks
This is weird because it is, spelled properly and everything
1 Like
Thanks! So the error is telling us that either the promptâs parent doesnât exist or the script is trying to find it in the wrong spot. You will need to verify that the script pointer (line 4) is pointing exactly to where the promptâs parent is found in the Explorer tab
Do you have any other scripts that could potentially be destroying âFridgeUiTriggerâ, and is it parented to the Workspace?
In short, you placed it either inside a folder, or itâs in another directory! (ex. ServerScriptService)
Make sure you drag the UI trigger into the workspace, or rescript it so it directs to the correct path.
You can look up FridgeUiTrigger in the explorer, and send a screenshot of it.
1 Like
You sure thereâs a ProximityPrompt inside it?
It is, just not when I look it up, see.
This is probably the most confusing, weirdest error I have ever gotten.