(SOLVED) Custom Proximity Prompt Help needed

I’ve looked at many sources of information, I’ve even resorted to youtube tutorials, for the life of me I CANNOT figure out why this code doesn’t work, the progress bar does absolutely nothing, the gui does show up although.
(Custom prox prompt, adding mobile support after this gets resolved)
Proximity Prompt’s style IS custom.

Any and all help is highly appreciated.

Local Script in PlayerGui.

local PPS = game:GetService("ProximityPromptService")
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local base = game.ReplicatedStorage:WaitForChild("ProxPrompt")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local currentTween

PPS.PromptShown:Connect(function(pp:ProximityPrompt)
	if pp.Style == Enum.ProximityPromptStyle.Default then return end

	local GUI = base:Clone()
	GUI.Parent = playerGui
	GUI.Enabled = true

	local progress = GUI:FindFirstChild("Progress")

	GUI.ActionText.Text = pp.ActionText

	if pp.KeyboardKeyCode ~= Enum.KeyCode.Unknown then
		GUI.Button.Text = pp.KeyboardKeyCode.Name
	elseif pp.GamepadKeyCode ~= Enum.KeyCode.Unknown then
		GUI.Button.Text = pp.GamepadKeyCode.Name
	else
		GUI.Button.Text = "Tap"
	end

	local holdBeganConnection = pp.PromptButtonHoldBegan:Connect(function()
		if progress then
			progress.Size = UDim2.new(1, 0, 0, 0)
			currentTween = TweenService:Create(progress, TweenInfo.new(pp.HoldDuration), {
				Size = UDim2.new(1, 0, 1, 0)})
			currentTween:Play()
		end
	end)
	local holdEndedConnection = pp.PromptButtonHoldEnded:Connect(function()
		if currentTween then
			currentTween:Cancel()
		end
		if progress then
			progress.Size = UDim2.new(1, 0, 0, 0)
		end
	end)

	pp.PromptHidden:Once(function()
		if GUI then
			GUI:Destroy()
		end
		if holdBeganConnection then holdBeganConnection:Disconnect() end
		if holdEndedConnection then holdEndedConnection:Disconnect() end
	end)
end)

If you need more information just ask me.


You could just use this ressource: Proximity Prompt Customizer, it is provided by a Roblox staff and require minimal work to customize prompt GUI without much difficulty.

1 Like

Do you get any error codes? First thing I notice is that the progress frame is parented to Button, but you are using :FindFirstChild() to search first children of BillboardGui. You have to give optional parameter recursive as true in :FindFirstChild("Progress").

Here it is, since progress variable is nil, this won’t continue. Set local progress = GUI:FindFirstChild("Progress") to local progress = GUI:FindFirstChild("Progress", true) and try again.

thx alot! you’ve ended my 6 hours of headaches.
worked almost exactly as intended

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.