What am I doing wrong?
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() while wait() do if Mouse.Target ~=nil and Mouse.Target.Name == 'HoverBrick' then script.Parent.BorderSizePixel = 5 else script.Parent.BorderSizePixel = 1 end end
I can't see any problems that might be occurring.
Try this code, and make sure it's in an Enabled LocalScript, put where it will run:
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Move:connect(function() if Mouse.Target ~=nil and Mouse.Target.Name == 'HoverBrick' then script.Parent.BorderSizePixel = 5 else script.Parent.BorderSizePixel = 1 end end)
Failing that, try enabling Output and see if any red text gets spit out at you.