If you dont manage to adapt it I can help you but I think you should message me cause we are reviving a solved topic lol
1 Like
It’s not really that, I will show you !
Okay, I’ll do that if I need help. Thank you!
EDIT: Final code:
local OriginalBuild = BuildPlatform.Build:GetChildren()[1]
local MaxCorrespondence = #OriginalBuild.Zone.Blocks:GetChildren()
for v, Zone in pairs(BuildingZones) do
if Zone:GetAttribute("userID") ~= nil then
local Correspondence = 0
for v, Part in pairs(Zone.Blocks:GetChildren()) do
for v, OtherPart in pairs(OriginalBuild.Zone.Blocks:GetChildren()) do
local OriginalZone = OriginalBuild.Zone
local Position = Part.CFrame:ToObjectSpace(Zone.CFrame)
local OtherPosition = OtherPart.CFrame:ToObjectSpace(OriginalZone.CFrame)
local roundedPosition = Vector3.new(math.round(Position.Position.X / GRIDSIZE) * GRIDSIZE,
math.round(Position.Position.Y / GRIDSIZE) * GRIDSIZE,
math.round(Position.Position.Z / GRIDSIZE) * GRIDSIZE)
local roundedOtherPosition = Vector3.new(math.round(OtherPosition.Position.X / GRIDSIZE) * GRIDSIZE,
math.round(OtherPosition.Position.Y / GRIDSIZE) * GRIDSIZE,
math.round(OtherPosition.Position.Z / GRIDSIZE) * GRIDSIZE)
if roundedPosition == roundedOtherPosition and Part.Name == OtherPart.Name then
Correspondence += 1
break
end
end
end
table.insert(results, {Zone:GetAttribute("userID"), Correspondence})
end
end
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.