#How do i make it so it detects how many parts and what parts are in a radius from the player
1 messages · Page 1 of 1 (latest)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local Radius = 10
local angle = math.rad(45)
local Attachments = {}
for i = 1, 36 do
local angle = math.rad((360 /36) * i)
local x = math.cos(angle) * Radius
local z = math.sin(angle) * Radius
local Position = Vector3.new(x,-3,z)
local Attachment = Instance.new("Attachment")
Attachment.Position = Position
Attachment.Visible = true
Attachment.Parent = hrp
table.insert(Attachments,Attachment)
end
print(Attachments)
for i = 1,#Attachments do
local Attachment0 =Attachments[i]
local Attachment1 = Attachments[(i % #Attachments) + 1]
local beam = Instance.new("Beam")
beam.Attachment0 = Attachment0
beam.Attachment1 = Attachment1
beam.Enabled = true
beam.Parent = hrp
end
is my radius visalizer script
but i want it to be on a different script to see how many parts are in the radius
and what parts
Use magnitude