I would like to close a Gui when a player is not over or under a brick. This means using part.Position and part.Size. Is there a way to combine these two and use .magnitude to make this statement false?
player=game.Players.LocalPlayer
flor=game.Workspace.flor
while wait(1) do
if not(player:DistanceFromCharacter(flor.Position)><=?) then
script.Parent.Parent.Visible=false
end
end

5 comments
Are you wanting to do this only when the player is touching the brick or do you want to do this whenever the player is directly above / below the brick?
What do you mean by "over"? In any of the space above? Even if there's another floor between you and the
florpart? Only standing directly on it?if the player is between the x and z coordinates of the part.
I could do a couple of if statements but I'd rather not.
Have you tried using a Region3 and just setting the Y value of the player's character to the Y of the brick so that you don't have to check that? http://wiki.roblox.com/index.php?title=API:Region3