i want to see if the part is in range of another part but it says the position is not a valid member of a model even though it is a part
heres the code:
if Destroy_Map == true then
for i, v in pairs(game.Workspace:GetDescendants()) do
if v.Name ~= NonAffected_Parts[1] then
if (script.Parent.Position - v.Position).magnitude <= ShockWave_Size*2 then
and the last line is bugging
script.Parent is a part
it worked before but to reduce lag i did some changes and then it does not work anymore
if Destroy_Map == true then
for i, v in pairs(game.Workspace:GetDescendants()) do
if v.Name ~= NonAffected_Parts[1] and v:IsA("BasePart") then
if (script.Parent.Position - v.Position).magnitude <= ShockWave_Size*2 then