Universal Script 📌
5.4k Views
516 Executions

AUTO INTERACT PROXIMITY PROMPT

Universal Script 📌
Fnfcharters
FnfchartersPublished 5
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

You're able to fire nearby prompt.

View Raw
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


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script 📌
47.6k
199.7k
Bumped 23 minutes ago
Key System
Universal Script 📌
334.8k
47.5k
Bumped 44 minutes ago
Script hub
41.7k
182.7k
Bumped 2 hours ago

Script hub

Sp3arParvus

Script hub
312
126
Bumped 3 hours ago
Universal Script 📌
223
10
Approved 7 hours ago