AUTO INTERACT PROXIMITY PROMPT
Key RequiredUniversal

AUTO INTERACT PROXIMITY PROMPT

Universal ScriptFnfchartersFnfcharters 5.2K views 339 executesUpdated Apr 6, 2025
5.0/ 5(2 votes)
20100% Positive
Lua Script•32 lines (1166 chars)
local Players = game:GetService("Players")
local player = Players.LocalPlayer

while true do
    local character = player.Character or player.CharacterAdded:Wait()
    local rootPart = character:WaitForChild("HumanoidRootPart")
    
    local active = true
    local characterRemovingConn = player.CharacterRemoving:Connect(function()
        active = false
        characterRemovingConn:Disconnect()
    end)

    while active do
        for _, instance in ipairs(workspace:GetDescendants()) do
            if instance:IsA("ProximityPrompt") then
                local prompt = instance
                local targetPart = prompt.Parent
                
                if targetPart and targetPart:IsA("BasePart") and rootPart and rootPart.Parent then
                    local distance = (targetPart.Position - rootPart.Position).Magnitude
                    if distance <= prompt.MaxActivationDistance then
                        prompt:InputHoldBegin()
                        task.wait(prompt.HoldDuration)
                        prompt:InputHoldEnd()
                    end
                end
            end
        end
        task.wait(0.2)
    end
end

Features & Information

You're able to fire nearby prompt.

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts