This script is meant to have a selectionbox appear over a block if your mouse is aimed at that block and that block is a certain height. This is the script:
while wait() do
if script.Parent.Size.Y >= 8 then
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local selection = Instance.new("SelectionBox")
selection.Color3 = Color3.new(0.6,0.6,0,6)
selection.Parent = player.PlayerGui
mouse.Move:connect(function()
local target = mouse.Target
if not target then
selection.Adornee = nil
elseif target == script.Parent then
selection.Adornee = target
else
selection.Adornee = nil
end
end)
end
This works fine when there is no conditional statement for the block's size.
How do I make this work with the size constraint. Do I have to use and?

2 comments
Wth you just copied and pasted my code and no it does not work..
now it should work