Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetSurface(part, pos)
- local rel = part.CFrame:pointToObjectSpace(pos)
- --if math.abs(rel.X) < part.Size.X and math.abs(rel.Y) < part.Size.Y and math.abs(rel.Z) < part.Size.Z then
- if math.abs(rel.Z) > math.abs(rel.Y) and math.abs(rel.Z) > math.abs(rel.X) then
- if rel.Z > 0 then
- return Enum.NormalId.Back
- else
- return Enum.NormalId.Front
- end
- elseif math.abs(rel.Y) > math.abs(rel.Z) and math.abs(rel.Y) > math.abs(rel.X) then
- if rel.Y > 0 then
- return Enum.NormalId.Top
- else
- return Enum.NormalId.Bottom
- end
- elseif math.abs(rel.X) > math.abs(rel.Z) and math.abs(rel.X) > math.abs(rel.Y) then
- if rel.X > 0 then
- return Enum.NormalId.Right
- else
- return Enum.NormalId.Left
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement