I make a selection box hover but everytime I make it breaks even though it's the same line and it should work..
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
while wait() do
if Mouse.Target ~=nil and Mouse.Target.Name == "Grab" then
script.Parent.HoverLabel.Visible = true
Mouse.Target.Select.Visible = true -- This line works but the other doesn't
else
script.Parent.HoverLabel.Visible = false
Mouse.Target.Select.Visible = false -- < Error for some reason
end
end
I don't know why?

6 comments
please add your code in a code block to make it readable :)
Also please tell us what the output error says
how to I make it into a code block?
Players.DayLighter_1995.PlayerGui.HoverGui.HoverClient:10: attempt to index nil with 'Select' is the output message.
while wait() do if Mouse.Target ~=nil and Mouse.Target.Name == "Grab" then script.Parent.HoverLabel.Visible = true Mouse.Target.Select.Visible = true -- This line works but the other doesn't else script.Parent.HoverLabel.Visible = false Mouse.Target.Select.Visible = false -- < Error for some reason end end
to put it in a code block you press the little lua icon that you see when you are editing or asking the questions and it will make a 'box' for you to put your code in