So Iam trying to make a drop spawning scipt so I can spawn drops but I want to check if the new drop is near a other drop and if it is too close then I want to reposition the drop to a better place. My script is down bellow and pleace notice that I use a module script to define the function of dropping and I call the function inside a serversided scipt. Somehow if I use :GetTouchingParts or :GetPartsInPart it doesn’t give the list of parts… because it doesn’t print them inside the console.
Just to clarify more I use an invisable part in the drops which are grouped models and want to check if the invisable part is touching another invisable part of an other drop. If so then it needs to not break the while true loop so it gets repositioned, if it isn’t touching then the while true loop needs to break.
while true do
local positionstable = GetPositions(droptype)
local position = Vector3.new(positionstable[1], 0.5, positionstable[2])
position = CFrame.new(position)
drop:PivotTo(position)
local touching = false
for i, part in pairs(drop:WaitForChild("NoDropArea"):GetTouchingParts()) do
print(part.Name)
if part.Name == "NoDropArea" then
touching = true
end
end
if touching == false then
break
end
wait()
end