What I’m trying to do is, well, Have a UI frame be opened with a ProximityPrompt, Now the script works but it is super slow for some reason. It works the first time its used but after that it for some reason forces you to hold the proximityprompt button multiple times until it will open again. When multiple people are trying to open the same thing it causes a bunch of problems to occur like it becoming even slower.
I’ve already tried to fix it on my own, but it either has the same outcome, or it only works once. The script is a normal script inside of a ProximityPrompt, and that is just inside a part.
t
local prompt = script.Parent
local open = false
prompt.Triggered:Connect(function(player)
local PlayerGui = player:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui.ScreenGui
local Frame = ScreenGui.StoreFrame
if open == false then
open = true
Frame.Visible = true
else
open = false
Frame.Visible = false
end
end)