so uh um i’ve got custom proximity prompts made, they are responsive and all of that (probably coded in the worst way imaginable but that’s okay!) but sometimes they just do not disappear
i’m not necessarily sure what the cause is since i have as much experience with proximity prompts as a child with rocket engineering (none)
local plr = game:GetService("Players").LocalPlayer
local plrGui = plr.PlayerGui.ProximityPrompts
-- // SERVICES
local RS = game:GetService("ReplicatedStorage")
local PPS = game:GetService("ProximityPromptService")
local TS = game:GetService("TweenService")
local Prompt = RS:WaitForChild("Prompt")
-- // TWEEN PARAMETERS
local info = TweenInfo.new(
.5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out
)
PPS.PromptShown:Connect(function(prompt, inputType)
if prompt.Style == Enum.ProximityPromptStyle.Default then return end
local newPrompt = Prompt:Clone()
newPrompt.Parent = plrGui
newPrompt.Adornee = prompt.Parent
local Popup = newPrompt:FindFirstChild("Popup")
Popup:Play()
for _,v in newPrompt:GetDescendants() do
if v.Name == "ObjectText" then
v.Text = prompt.Parent.Parent.Parent.Name
elseif v.Name == "ActionText" then
-- // I am so sorry for this
if prompt.Parent.Parent:IsA("Tool") then
v.Text = "Take"
elseif prompt.Parent.Parent:IsA("MeshPart") then
v.Text = "Open"
end
end
end
local OpenTween = TS:Create(newPrompt, info, {Size = UDim2.new(0, 200, 0, 100)})
OpenTween:Play()
OpenTween.Completed:Wait()
OpenTween:Destroy()
end)
PPS.PromptHidden:Connect(function(prompt, inputType)
local promptGui = plrGui:FindFirstChild("Prompt")
if promptGui then
local CloseTween = TS:Create(promptGui, info, {Size = UDim2.new(0,0,0,100)})
local PopupClose = promptGui:FindFirstChild("PopupClose")
PopupClose:Play()
CloseTween:Play()
CloseTween.Completed:Wait()
CloseTween:Destroy()
promptGui:Destroy()
else
return
end
end)
the results are rather…