With this script it makes all proximity prompts custom prompts, for some reason the progress bar doesn’t tween, could somebody help me out?
Script:
local ProximityPromptService = game:GetService("ProximityPromptService")
ProximityPromptService.PromptShown:Connect(function(prompt)
prompt.Style = Enum.ProximityPromptStyle.Custom
local interactionBillboardGui = script.InteractionBillboardGui:Clone()
interactionBillboardGui.Parent = prompt.Parent
interactionBillboardGui.Enabled = true
interactionBillboardGui.Interact.Information.Information.Text = prompt.ActionText
interactionBillboardGui.Interact.Button.TextLabel.Text = prompt.KeyboardKeyCode.Name
if prompt.HoldDuration >= 0 then
interactionBillboardGui.HoldBar.Visible = true
interactionBillboardGui.Interact.Button.HoldText.Visible = true
else
interactionBillboardGui.HoldBar.Visible = false
interactionBillboardGui.Interact.Button.HoldText.Visible = false
end
local holdBar = interactionBillboardGui:WaitForChild("HoldBar")
local holdDuration = prompt.HoldDuration
local holdTween
local function startHold()
holdTween = holdBar.Progress:TweenSize(UDim2.new(1, 0, 1, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, holdDuration, true)
end
local function stopHold()
if holdTween then
holdBar.Progress:TweenSize(UDim2.new(0, 0, 1, 0), nil, Enum.EasingStyle.Quad, 0.1, true)
end
end
prompt.PromptButtonHoldBegan:Connect(startHold)
prompt.PromptButtonHoldEnded:Connect(stopHold)
ProximityPromptService.PromptHidden:Connect(function(hiddenPrompt)
local promptGui = hiddenPrompt.Parent:FindFirstChild("InteractionBillboardGui")
if promptGui then
promptGui:Destroy()
end
end)
end)
local ProximityPromptService = game:GetService("ProximityPromptService")
local TweenService = game:GetService("TweenService")
ProximityPromptService.PromptShown:Connect(function(prompt)
prompt.Style = Enum.ProximityPromptStyle.Custom
local interactionBillboardGui = script.InteractionBillboardGui:Clone()
interactionBillboardGui.Parent = prompt.Parent
interactionBillboardGui.Enabled = true
interactionBillboardGui.Interact.Information.Information.Text = prompt.ActionText
interactionBillboardGui.Interact.Button.TextLabel.Text = prompt.KeyboardKeyCode.Name
local holdBar = interactionBillboardGui:WaitForChild("HoldBar")
local holdDuration = prompt.HoldDuration
local function startHold()
interactionBillboardGui:WaitForChild("HoldBar").Progress:TweenSize(UDim2.new(1, 0, 1, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, holdDuration, true)
end
local function stopHold()
interactionBillboardGui:WaitForChild("HoldBar").Progress.Size = UDim2.new(0, 0, 1, 0)
end
prompt.PromptButtonHoldBegan:Connect(startHold)
prompt.PromptButtonHoldEnded:Connect(stopHold)
if prompt.HoldDuration ~= 0 then
interactionBillboardGui.HoldBar.Visible = true
interactionBillboardGui.Interact.Button.HoldText.Visible = true
elseif prompt.HoldDuration == 0 then
interactionBillboardGui.HoldBar.Visible = false
interactionBillboardGui.Interact.Button.HoldText.Visible = false
end
local function promptHidden(hiddenPrompt)
local promptGui = hiddenPrompt.Parent:FindFirstChild("InteractionBillboardGui")
if promptGui then
promptGui:Destroy()
end
end
ProximityPromptService.PromptHidden:Connect(promptHidden)
end)
local ProximityPromptService = game:GetService(“ProximityPromptService”)
local TweenService = game:GetService(“TweenService”)
local tweenInfo = TweenInfo.new(5) - should be tween time length
local holdBar = interactionBillboardGui:WaitForChild("HoldBar")
local holdDuration = prompt.HoldDuration
local function startHold()
local tweenInfo = TweenInfo.new(
2, – Time
Enum.EasingStyle.Linear, – EasingStyle
Enum.EasingDirection.Out, – EasingDirection
-1, – RepeatCount (when less than zero the tween will loop indefinitely)
true, – Reverses (tween will reverse once reaching it’s goal)
0 – DelayTime
)
local tween = TweenService:Create(interactionBillboardGui, tweenInfo, { Position = Vector3.new(0, 30, 0) })
tween:Play()
end
local function stopHold()
interactionBillboardGui:WaitForChild("HoldBar").Progress.Size = UDim2.new(0, 0, 1, 0)
end
prompt.PromptButtonHoldBegan:Connect(startHold)
prompt.PromptButtonHoldEnded:Connect(stopHold)
if prompt.HoldDuration ~= 0 then
interactionBillboardGui.HoldBar.Visible = true
interactionBillboardGui.Interact.Button.HoldText.Visible = true
elseif prompt.HoldDuration == 0 then
interactionBillboardGui.HoldBar.Visible = false
interactionBillboardGui.Interact.Button.HoldText.Visible = false
end
local function promptHidden(hiddenPrompt)
local promptGui = hiddenPrompt.Parent:FindFirstChild("InteractionBillboardGui")
if promptGui then
promptGui:Destroy()
end
end
ProximityPromptService.PromptHidden:Connect(promptHidden)
end)
On mobile so you probably need to fix it but you are missing tween info, and playing the tween.