local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
target = mouse.Target
local billboard
while true do
if target.Parent == game.Workspace.Items then
billboard = mouse.Target.BillboardGui
billboard.Enabled = true
print("Mouse hovering over food")
else
billboard.Enabled = false
end
wait(.1)
end
target is fine, but target.Parent isn't why not?
local script in starter pack

1 comment
mouse.Target can be nil if the mouse doesn't have a target. Code block if mouse.Target is not nil before you do anything.