#i want to get the found part to detected part location any help appreciated (UNSOLVED)

6 messages · Page 1 of 1 (latest)

vapid widget
#

i want to get the found part to detected part location any help appreciated (UNSOLVED)

#

so i made a tool detects parts within a selected range but i want to get the found part position to detected part position

#

client

#
local replicated = game:GetService("ReplicatedStorage")
local folder = game.Workspace:WaitForChild("Areas")
local tools = require(replicated.Modules.Tools)
local starterdetector = tools['Starter Detector']
local detectionrange = starterdetector['Range']
local found = script:WaitForChild("Found")
local tool = script.Parent
local debounce = true

tool.Activated:Connect(function()
    if debounce == true then
        debounce = false
        print("debounce on")
    local plr = game.Players.LocalPlayer
    local toolposition = tool.Handle.Position
    
    for _, part in pairs(folder:GetChildren()) do
        for _, area in pairs(part:GetChildren()) do
            local distance = (area.Position - toolposition).Magnitude
                if distance <= detectionrange then
                    print('detecting parts')
                    wait(3)
                    print("debounce off")
                    debounce = true
                end
            end
        end
    end
end)
#

server