#How to make a custom proximity prompt?
1 messages · Page 1 of 1 (latest)
Ì can make it work, but I don't know how to make the progress ring
heres my script:local ProximityPromptService = game:GetService("ProximityPromptService")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local isMobile = UserInputService.TouchEnabled
ProximityPromptService.PromptShown:Connect(function(promptInstance: ProximityPrompt)
if promptInstance.Style == Enum.ProximityPromptStyle.Default then return end
local CustomProximity = game.ReplicatedStorage:WaitForChild("CustomProximity"):Clone()
local frame = CustomProximity:WaitForChild("Frame")
local actionText = CustomProximity:WaitForChild("ActionText")
local keyIconPc = frame:WaitForChild("KeyIconPc")
local keyIconMobile = frame:WaitForChild("KeyIconMobile")
local mobileButton = frame:WaitForChild("MobileButton")
actionText.Text = promptInstance.ActionText
keyIconPc.Visible = not isMobile
keyIconMobile.Visible = isMobile
mobileButton.Visible = isMobile
CustomProximity.Parent = promptInstance.Parent
local icon = isMobile and keyIconMobile or keyIconPc
icon.AnchorPoint = Vector2.new(0.5, 0.5)
local normalSize = icon.Size
local bigSize = UDim2.new(
normalSize.X.Scale * 1.3, normalSize.X.Offset,
normalSize.Y.Scale * 1.3, normalSize.Y.Offset
)
local tweenIn = TweenService:Create(icon, TweenInfo.new(promptInstance.HoldDuration, Enum.EasingStyle.Linear), {
Size = bigSize
})
local tweenOut = TweenService:Create(icon, TweenInfo.new(0.1), {
Size = normalSize
})
local holdBeganConnection = promptInstance.PromptButtonHoldBegan:Connect(function()
tweenIn:Play()
end)
local holdEndedConnection = promptInstance.PromptButtonHoldEnded:Connect(function()
tweenOut:Play()
end)
local mobileButtonConnection = mobileButton.Activated:Connect(function()
promptInstance:InputHoldBegin()
task.wait(promptInstance.HoldDuration)
promptInstance:InputHoldEnd()
end)
promptInstance.PromptHidden:Once(function()
CustomProximity:Destroy()
mobileButtonConnection:Disconnect()
holdBeganConnection:Disconnect()
holdEndedConnection:Disconnect()
end)
end)
billboard ~= proximity prompt
you can use a proximity prompt object and check when it's activated
to make a custom one i'd recommend using this
ah wait i can't find it
i believe you have to set proximity prompt style to custom and put a billboard under it with same format as a actual proximity prompt
I already did look at my script
your not putting it under it
your putting it in the parent
Huh?